-
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, ..)P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
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.
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, ..)P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.