-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
A-macromacro expansionmacro expansionS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now
Description
In a repetition of a rule (e.g. expr, ident) that can cover _, and matching a _ directly, the _ is matched by the repetition causing the _ rule to fail and produces an expected leaf: `_` error.
rustc on the latest stable and nightly matches these macro invocations without any errors.
Minimal reproducible examples:
macro_rules! seq1 {
($($a:ident)* _) => {};
}
// `_` overlaps with `$a:ident` but rustc matches it under the `_` token
seq1![a b c d _]; // expected leaf: `_`macro_rules! seq2 {
($($a:expr => $b:ident)* _ => $c:expr) => {};
}
// `_ => ou` overlaps with `$a:expr => $b:ident` but rustc matches it under `_ => $c:expr`
seq2![a => b c => d _ => ou]; // expected leaf: `_`Metadata
Metadata
Assignees
Labels
A-macromacro expansionmacro expansionS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now