The reference seems to indicate that #[macro_export(local_inner_macros)] does not accept additional values for local_inner_macros. However, the following code currently compiles without errors.
#[macro_export(local_inner_macros(false))]
macro_rules! foo {
() => {};
}
#[macro_export(local_inner_macros = false)]
macro_rules! bar {
() => {};
}
As far as I can tell, the false value 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 of false.)
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)
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)