use syn::{parse_macro_input, FnArg, TraitItemMethod};
^^^^^ ^^^^^^^^^^^^^^^ no TraitItemMethod in the root
no FnArg in the root
note: found an item that was configured out
--> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:363:5
^^^^^
= note: the item is gated behind the full feature
note: found an item that was configured out
--> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:367:59
= note: the item is gated behind the `full` feature
error[E0433]: failed to resolve: could not find TraitItem in syn
--> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/feign-macros-0.1.6/src/lib.rs:59:18
|
59 | syn::TraitItem::Method(m) => Some(m),
| ^^^^^^^^^ could not find TraitItem in syn
error[E0412]: cannot find type ItemTrait in crate syn
--> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/feign-macros-0.1.6/src/lib.rs:29:50
29
let input = parse_macro_input!(input as syn::ItemTrait);
^^^^^^^^^ not found in syn
note: found an item that was configured out
--> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:366:29
|
366 | ItemStatic, ItemStruct, ItemTrait, ItemTraitAlias, ItemType, ItemUnion, ItemUse, Receiver,
| ^^^^^^^^^
= note: the item is gated behind the full feature
error[E0412]: cannot find type Pat in crate syn
--> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/feign-macros-0.1.6/src/lib.rs:372:23
372
Form(&'a Box),
^^^ help: a struct with a similar name exists: Path
/// A path at which a named item is exported (e.g. std::collections::HashMap).
6
///
7
/// *This type is available only if Syn is built with the "derive" or "full"
...
13
}
14
}
_- similarly named struct Path defined here
note: found an item that was configured out
--> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:417:15
|
417 | FieldPat, Pat, PatBox, PatIdent, PatLit, PatMacro, PatOr, PatPath, PatRange, PatReference,
| ^^^
= note: the item is gated behind the full feature
error[E0412]: cannot find type Pat in crate syn
--> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/feign-macros-0.1.6/src/lib.rs:373:23
373
Json(&'a Box),
^^^ help: a struct with a similar name exists: Path
/// A path at which a named item is exported (e.g. std::collections::HashMap).
6
///
7
/// *This type is available only if Syn is built with the "derive" or "full"
...
13
}
14
}
_- similarly named struct Path defined here
note: found an item that was configured out
--> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:417:15
|
417 | FieldPat, Pat, PatBox, PatIdent, PatLit, PatMacro, PatOr, PatPath, PatRange, PatReference,
| ^^^
= note: the item is gated behind the full feature
let args: ClientArgs = match ClientArgs::from_list(&args) {
--------------------- ^^^^^ expected &[NestedMeta], found &Vec<NestedMeta>
arguments to this function are incorrect
= note: expected reference `&[darling::ast::NestedMeta]`
found reference `&Vec<syn::NestedMeta>`
note: associated function defined here
--> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/darling_core-0.20.3/src/from_meta.rs:101:8
|
101 | fn from_list(items: &[NestedMeta]) -> Result {
| ^^^^^^^^^
darling 版本问题导致编译失败: 因为feign-macros的cargo.toml的版本依赖是darling = "0",而这总会安装最新的前缀的0.开头的版本,最新的版本同作者的程序不兼容,参考:https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html
解决方案:
[dependencies] darling = "=0.13.4" proc-macro-error = "1" proc-macro2 = "1" quote = "1" syn = "1"
[lib] proc-macro = true
syn::FnArg
,syn::TraitItemMethod
--> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/feign-macros-0.1.6/src/lib.rs:9:30TraitItemMethod
in the rootFnArg
in the rootfull
feature note: found an item that was configured out --> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:367:59error[E0433]: failed to resolve: could not find
TraitItem
insyn
--> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/feign-macros-0.1.6/src/lib.rs:59:18 | 59 | syn::TraitItem::Method(m) => Some(m), | ^^^^^^^^^ could not findTraitItem
insyn
ItemTrait
in cratesyn
--> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/feign-macros-0.1.6/src/lib.rs:29:50syn
note: found an item that was configured out --> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:366:29 | 366 | ItemStatic, ItemStruct, ItemTrait, ItemTraitAlias, ItemType, ItemUnion, ItemUse, Receiver, | ^^^^^^^^^ = note: the item is gated behind the
full
featurePat
in cratesyn
--> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/feign-macros-0.1.6/src/lib.rs:372:23Path
std::collections::HashMap
). 6"derive"
or"full"
...Path
defined herenote: found an item that was configured out --> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:417:15 | 417 | FieldPat, Pat, PatBox, PatIdent, PatLit, PatMacro, PatOr, PatPath, PatRange, PatReference, | ^^^ = note: the item is gated behind the
full
featurePat
in cratesyn
--> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/feign-macros-0.1.6/src/lib.rs:373:23Path
std::collections::HashMap
). 6"derive"
or"full"
...Path
defined herenote: found an item that was configured out --> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:417:15 | 417 | FieldPat, Pat, PatBox, PatIdent, PatLit, PatMacro, PatOr, PatPath, PatRange, PatReference, | ^^^ = note: the item is gated behind the
full
feature&[NestedMeta]
, found&Vec<NestedMeta>
note: associated function defined here --> /Users/feihuang.huang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/darling_core-0.20.3/src/from_meta.rs:101:8 | 101 | fn from_list(items: &[NestedMeta]) -> Result {
| ^^^^^^^^^