You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which means the parse of the ItemImpl will consume the attrs in its input ParseStream.
which cause if i want to use parse_macro_input! to get my own ItemImplOrFn, i will loss func attrs.
which also not match below declaration in official docs:
Expected: Stop Consuming attrsr
ItemImpl::parse not consume attrs ,then below can be pass
let code = quote!{/// Hellofn hello(){}};letItemImplOrFn::Fn(func) = syn::parse2(code).unwrap()else{unreachable!()};assert!(!func.attrs.is_empty());
The text was updated successfully, but these errors were encountered:
code example
write below to src/main.rs
the Cargo.toml dependencies for this code:
cargo run
, then you will see:which means the parse of the ItemImpl will consume the attrs in its input ParseStream.
which cause if i want to use parse_macro_input! to get my own ItemImplOrFn, i will loss func attrs.
which also not match below declaration in official docs:
Expected: Stop Consuming attrsr
ItemImpl::parse not consume attrs ,then below can be pass
The text was updated successfully, but these errors were encountered: