Closed
Description
macro_rules! foo {
($($t:ident),*/) => {()};
}
fn main() {
foo!(a, b/); // works fine
foo!(a/); // works fine
foo!(/); // local ambiguity error ☹
}
error: local ambiguity: multiple parsing options: built-in NTs ident ('t') or 1 other option.
--> <anon>:8:10
8 |> foo!(/);
|> ^
In this case, it should be looking for an ident or a /
, in which there is no ambiguity.
All channels are affected.
This is affecting my ability to write macros accepting generics using angle brackets, e.g. $ty:ident<$($x:ident),*>
, with a supporting pattern to turn Foo
into Foo<>
.
May be related to #24827.