-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-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.
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).
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-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.