Confusing source location for "missing fragment specifier" #95463
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
A-parser
Area: The parsing of Rust source code to an AST
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Here's some code incorrectly defining a macro, because it's missing a fragment specifier. Playground
Here's the error message rustc gives me:
It's potentially confusing that the error points to the source after the name with the missing fragment specifier. Especially in a complicated macro, it would be better if it pointed to the item which was actually missing the fragment specifier.
The text was updated successfully, but these errors were encountered: