Closed
Description
This:
macro_rules! foo {
($bar) => {};
($baz $qux:ident) => {};
}
Produces:
error: missing fragment specifier
--> src/lib.rs:2:6
|
2 | ($bar) => {};
| ^^^^
...
error: missing fragment specifier
--> src/lib.rs:3:11
|
3 | ($baz $qux:ident) => {};
| ^
Notice for the second pattern, the diagnostic points at $qux
rather than $baz
. $qux
is not a problem here, the span should look similar to $bar
.
Tested on both 1.80 and the 2024-08-13 nightly. This affects the new diagnostic that applies to e2024 added in #128006, as well as the existing lint (I noticed it looking at the reports in #128425).