-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
Description
...or at least that's how much I currently understand, since macros are really counterintuitive sometimes.
macro_rules! m {
( $i:ident ) => ();
( $t:tt $j:tt ) => ();
}
fn main() {
m!(c);
m!(t 9); // why does this work, but not the next case?
m!(0 9);
// ^ error: expected ident, found 0
}
I don't think this is supposed to happen. Even if it is, the exact rules used for macro matching should definitely be documented somewhere (I think there's not even an RFC).
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, ..)