Closed
Description
Macro-expanded unconfigured items are gated feature checked, but ordinary unconfigured items are not. For example, the following should compile, ...
#![cfg_attr(attr, feature(rustc_attrs))]
macro_rules! mac {
{} => {
#[cfg(attr)]
mod m {
#[rustc_error] // ... but if not(attr), this complains about the lack of the rustc_attrs feature
fn f() {}
}
}
}
mac! {}
If we manually expand mac! {}
, it always compiles:
#![cfg_attr(attr, feature(rustc_attrs))]
#[cfg(attr)]
mod m {
#[rustc_error]
fn f() {}
}
Metadata
Metadata
Assignees
Labels
No labels