cargo build
fails but building macro-expanded file works
#81183
Labels
A-attributes
Area: Attributes (`#[…]`, `#![…]`)
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
A-proc-macros
Area: Procedural macros
C-bug
Category: This is a bug.
Cargo.toml:
The 'tracing' package is https://github.com/tokio-rs/tracing master branch (fe570af).
main.rs:
If I build this with current rustc master (4ba1aaf):
However if I expand the macro/attribute using the same rustc using
cargo-expand
and replace main.rs with the expanded code, it builds fine. Expanded code:Interestingly
cargo expand
prints the same error ("an inner attribute is not permitted in this context") but it's still able to expand the code, and expanded code works.The text was updated successfully, but these errors were encountered: