Closed
Description
This is a stable-to-beta regression, but it's such a weird thing to do that I don't know if it counts.
Consider the following code (playpen):
macro_rules! gen {
($name:ident ($($dol:tt $var:ident)*) $($body:tt)*) => {
macro_rules! $name {
($($dol $var:ident)*) => {
$($body)*
}
}
}
}
The gen
macro parses a macro argument spec by matching a dollar sign with $dol
and the fragment name with $var
. Then (in this toy example) it just regurgitates that adding :ident
as the type of each fragment.
This works in 1.17, but fails when invoked in 1.18 and nightly with the message "expected identifier, found [the ident passed in for $var
]", pointing at $var
on line 4. All three channels work if $var:ident
is changed to $var:tt
on line 2.