-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed as not planned
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)T-langRelevant to the language teamRelevant to the language teamWG-macrosWorking group: MacrosWorking group: Macros
Description
true
and false
are now accepted config options. However, they aren't accepted by the meta
fragment specifier:
macro_rules! demo {
($m:meta) => {
#[cfg($m)]
println!("hi {}", stringify!($m));
}
}
fn main() {
demo!(any());
demo!(all());
demo!(true);
demo!(false);
}
error: expected identifier, found keyword `true`
--> src/main.rs:11:11
|
11 | demo!(true);
| ^^^^ expected identifier, found keyword
error: expected identifier, found keyword `false`
--> src/main.rs:12:11
|
12 | demo!(false);
| ^^^^^ expected identifier, found keyword
We should consider whether we want to accept this in the next edition, keeping the current :meta
matcher behavior as :meta_2024
.
Metadata
Metadata
Assignees
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)T-langRelevant to the language teamRelevant to the language teamWG-macrosWorking group: MacrosWorking group: Macros