[Bug 2329411] Review Request: rust-neli-proc-macros - Procedural macros for neli

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=2329411



--- Comment #7 from Stefano Brivio <sbrivio@xxxxxxxxxx> ---
(In reply to Fabio Valentini from comment #6)
> Taking this review.

Thanks a lot! I'm addressing your comments. I'm currently at point 6.:

> 6. This project still uses version 1 of the "syn" crate. This version has
> been obsolete for almost two years at this point, and it will likely fail to
> parse Rust code that is valid syntax in future Rust versions. Please poke
> upstream project to port to "syn" v2. In most cases, this should be easy and
> require little to no code changes.

...this one is taking a bit more effort than expected. With syn 2.0.90:

--
   Compiling neli-proc-macros v0.2.0-rc2 (/home/sbrivio/neli/neli-proc-macros)
error[E0432]: unresolved imports `syn::token::Add`, `syn::token::Colon2`,
`syn::NestedMeta`
  --> src/shared.rs:9:13
   |
9  |     token::{Add, Colon2},
   |             ^^^  ^^^^^^ no `Colon2` in `token`
   |             |
   |             no `Add` in `token`
10 |     Attribute, Expr, Fields, FieldsNamed, FieldsUnnamed, GenericParam,
Generics, Ident, Index,
11 |     ItemStruct, Lit, Meta, MetaNameValue, NestedMeta, Path, PathArguments,
PathSegment, Token,
   |                                           ^^^^^^^^^^ no `NestedMeta` in
the root
   |
   = help: consider importing one of these items instead:
           std::ops::Add
           syn::BinOp::Add
help: a similar name exists in the module
   |
9  |     token::{And, Colon2},
   |             ~~~
help: a similar name exists in the module
   |
9  |     token::{Add, Colon},
   |                  ~~~~~

error[E0599]: no method named `parse_meta` found for reference `&Attribute` in
the current scope
   --> src/shared.rs:227:36
    |
227 |             if let Ok(meta) = attr.parse_meta() {
    |                                    ^^^^^^^^^^
    |
help: there is a method `parse_nested_meta` with a similar name, but with
different arguments
   -->
/home/sbrivio/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-2.0.90/src/attr.rs:391:5
    |
391 | /     pub fn parse_nested_meta(
392 | |         &self,
393 | |         logic: impl FnMut(ParseNestedMeta) -> Result<()>,
394 | |     ) -> Result<()> {
    | |___________________^

error[E0609]: no field `tokens` on type `&Attribute`
   --> src/shared.rs:235:70
    |
235 |                 panic!("Could not parse provided attribute {}",
attr.tokens,)
    |                                                                     
^^^^^^ unknown field
    |
    = note: available fields are: `pound_token`, `style`, `bracket_token`,
`meta`

error[E0599]: no method named `parse_meta` found for struct `Attribute` in the
current scope
   --> src/shared.rs:281:18
    |
281 |             attr.parse_meta()
    |                  ^^^^^^^^^^
    |
help: there is a method `parse_nested_meta` with a similar name, but with
different arguments
   -->
/home/sbrivio/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-2.0.90/src/attr.rs:391:5
    |
391 | /     pub fn parse_nested_meta(
392 | |         &self,
393 | |         logic: impl FnMut(ParseNestedMeta) -> Result<()>,
394 | |     ) -> Result<()> {
    | |___________________^

error[E0609]: no field `tokens` on type `Attribute`
   --> src/shared.rs:282:81
    |
282 |                 .unwrap_or_else(|_| panic!("Failed to parse attribute
{}", attr.tokens))
    |                                                                          
      ^^^^^^ unknown field
    |
    = note: available fields are: `pound_token`, `style`, `bracket_token`,
`meta`

error[E0599]: no method named `parse_meta` found for reference `&Attribute` in
the current scope
   --> src/shared.rs:376:14
    |
375 |           let meta = attr
    |  ____________________-
376 | |             .parse_meta()
    | |_____________-^^^^^^^^^^
    |
help: there is a method `parse_nested_meta` with a similar name, but with
different arguments
   -->
/home/sbrivio/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-2.0.90/src/attr.rs:391:5
    |
391 | /     pub fn parse_nested_meta(
392 | |         &self,
393 | |         logic: impl FnMut(ParseNestedMeta) -> Result<()>,
394 | |     ) -> Result<()> {
    | |___________________^

error[E0609]: no field `tokens` on type `&Attribute`
   --> src/shared.rs:377:77
    |
377 |             .unwrap_or_else(|_| panic!("Failed to parse attribute {}",
attr.tokens));
    |                                                                          
  ^^^^^^ unknown field
    |
    = note: available fields are: `pound_token`, `style`, `bracket_token`,
`meta`

error[E0609]: no field `nested` on type `MetaList`
   --> src/shared.rs:380:36
    |
380 |                 for nested in list.nested {
    |                                    ^^^^^^ unknown field
    |
    = note: available fields are: `path`, `delimiter`, `tokens`

error[E0599]: no method named `parse_meta` found for reference `&Attribute` in
the current scope
   --> src/shared.rs:407:14
    |
406 |           let meta = attr
    |  ____________________-
407 | |             .parse_meta()
    | |_____________-^^^^^^^^^^
    |
help: there is a method `parse_nested_meta` with a similar name, but with
different arguments
   -->
/home/sbrivio/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-2.0.90/src/attr.rs:391:5
    |
391 | /     pub fn parse_nested_meta(
392 | |         &self,
393 | |         logic: impl FnMut(ParseNestedMeta) -> Result<()>,
394 | |     ) -> Result<()> {
    | |___________________^

error[E0609]: no field `tokens` on type `&Attribute`
   --> src/shared.rs:408:77
    |
408 |             .unwrap_or_else(|_| panic!("Failed to parse attribute {}",
attr.tokens));
    |                                                                          
  ^^^^^^ unknown field
    |
    = note: available fields are: `pound_token`, `style`, `bracket_token`,
`meta`

error[E0609]: no field `nested` on type `MetaList`
   --> src/shared.rs:411:36
    |
411 |                 for nested in list.nested {
    |                                    ^^^^^^ unknown field
    |
    = note: available fields are: `path`, `delimiter`, `tokens`

error[E0026]: struct `MetaNameValue` does not have a field named `lit`
   --> src/shared.rs:414:25
    |
414 |                         lit: Lit::Str(lit),
    |                         ^^^ struct `MetaNameValue` does not have this
field

error[E0609]: no field `lit` on type `MetaNameValue`
  --> src/neli_enum.rs:13:38
   |
13 |             if let Lit::Str(ls) = nv.lit {
   |                                      ^^^ unknown field
   |
   = note: available fields are: `path`, `eq_token`, `value`

Some errors have detailed explanations: E0026, E0432, E0599, E0609.
For more information about an error, try `rustc --explain E0026`.
error: could not compile `neli-proc-macros` (lib) due to 13 previous errors
--

...I'm currently figuring out how to fix those so that I can propose the change
upstream.


-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
https://bugzilla.redhat.com/show_bug.cgi?id=2329411

Report this comment as SPAM: https://bugzilla.redhat.com/enter_bug.cgi?product=Bugzilla&format=report-spam&short_desc=Report%20of%20Bug%202329411%23c7

-- 
_______________________________________________
package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/package-review@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite Conditions]     [KDE Users]

  Powered by Linux