-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Invalid value accepted for #[macro_export(local_inner_macros)] #154977
Copy link
Copy link
Open
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The reference seems to indicate that
#[macro_export(local_inner_macros)]does not accept additional values forlocal_inner_macros. However, the following code currently compiles without errors.As far as I can tell, the
falsevalue is entirely ignored, making the attributes equivalent to just#[macro_export(local_inner_macros)]. (The same is true when using string literals and numerical literals instead offalse.)I think this code should probably be rejected.
The parsing of this attribute was ported to the new attribute parsing infrastructure in #143857.
cc @JonathanBrouwer @jdonszelmann @Periodic1911
Meta
Reproducible on the playground with version
1.96.0-nightly (2026-04-07 c756124775121dea0e64)