using inner tool attributes in crate root induces compiler error on intra-crate macro use #74087
Labels
A-attributes
Area: Attributes (`#[…]`, `#![…]`)
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
A-resolve
Area: Name/path resolution done by `rustc_resolve` specifically
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Take a crate that has the following
foo.rs
, that contains a macro,foomacro()!
:This macro is used in
bar.rs
:Finally, here is the root of the crate and
main.rs
:As the comment there indicates, as written, this compiles and runs as expected:
If, however, either of the inner tool attributes is uncommented, the code fails on compiling
bar.rs
, complaining about its use offoomacro()!
This behavior seems surprising, especially because tool attributes are generally thought to only be relevant to the specified tool:
Thanks in advance for any consideration of this issue -- and apologies if this is an elaborate form of pilot error!
The text was updated successfully, but these errors were encountered: