Closed
Description
Here's some code incorrectly defining a macro, because it's missing a fragment specifier. Playground
macro_rules! m {
($x [$y: ident]) => {}
}
Here's the error message rustc gives me:
error: missing fragment specifier
[--> src/lib.rs:2:9
](https://play.rust-lang.org/#) |
2 | ($x [$y: ident]) => {}
| ^^^^^^^^^^^
|
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.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: The lexing & parsing of Rust source code to an ASTDiagnostics: Confusing error or lint that should be reworked.Diagnostics: An error or lint that needs small tweaks.Relevant to the compiler team, which will review and decide on the PR/issue.