Unhelpful error when macro_rules macro name is missing #118295
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
A-resolve
Area: Name/path resolution done by `rustc_resolve` specifically
D-newcomer-roadblock
Diagnostics: Confusing error or lint; hard to understand for new users.
D-terse
Diagnostics: An error or lint that doesn't give enough information about the problem at hand.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
The syntax for how an ident is given to
macro_rules!
is unlike any other macro invocation. New Rust users would typically have more experience calling macros (println!
) before defining their own macros. There may be a period in which the bespokemacro_rules
syntax is tricky to build muscle memory for.Other cases
When name of a function is omitted, this is still a better error than "cannot find 'fn' in this scope".
The text was updated successfully, but these errors were encountered: