-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Better help text for incorrect macro_rules! usage #150899
Copy link
Copy link
Closed
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, ..)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.
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, ..)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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Code
Current output
Desired output
Rationale and extra context
I was trying to define a macro from memory, and my memory failed me 😅 My brain thought the syntax was
macro_rules!(macro_name) {}, but the parentheses can't go there.I have no idea how common of a mistake this is and if it's worth special casing; I'm happy with whatever judgment call yinz make :)
Other cases
Rust Version
Anything else?
No response