Open
Description
This (playground) fails:
macro_rules! foo {
($($m:meta => $i:item)* _ => $j:item) => {};
}
foo! {
_ => { fn f() -> i32 { 2 } }
}
fn main() { f(); }
error: local ambiguity: multiple parsing options: built-in NTs meta ('m') or 1 other option.
--> src/main.rs:6:5
|
6 | _ => { fn f() -> i32 { 2 } }
| ^
macro_rules! foo {
($m:meta) => {};
(_ => { $i:item }) => {
$i
};
}
foo! {
_ => { fn f() -> i32 { 2 } }
}
fn main() { f(); }
error: expected identifier, found reserved identifier `_`
--> src/main.rs:9:5
|
9 | _ => { fn f() -> i32 { 2 } }
| ^ expected identifier, found reserved identifier
I believe both cases should work because meta
should not match pseudo-identifiers.
Metadata
Metadata
Assignees
Labels
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Category: This is a bug.Status: A Minimal Complete and Verifiable Example has been found for this issueRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the language team, which will review and decide on the PR/issue.