-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.P-mediumMedium priorityMedium priorityT-langRelevant to the language teamRelevant to the language team
Description
You can use a repetition to get around the future proofer.
macro_rules! bad {
($e:expr $i:ident) => {} //~ERROR
}
macro_rules! sneaky {
($($i:ident $e:expr)*) => {} // no error
}
fn main() {
sneaky!(a b c d);
}
I feel that both of these should be accepted, or neither. BTW, I am using the equivalent of sneaky!
in brainmunch (found this while preparing my RustFest talk).
Fixing this by disallowing both macros would require cratering.
ExpHP and estebank
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, ..)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.P-mediumMedium priorityMedium priorityT-langRelevant to the language teamRelevant to the language team