- Notifications
You must be signed in to change notification settings - Fork 13.8k
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, ..)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.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
I’ll admit, the whole error message is not too bad if you ignore the first line.
If only it wouldn’t suggest that 1 + 1
is not an expression...
macro_rules! test { (let $p:pat = $e:expr) => {test!(($p,$e))}; // actual mistake: this should be expr // vvv (($p:pat, $e:pat)) => {let $p = $e;}; } fn foo() { test!(let x = 1+1); }
Errors:
Compiling playground v0.0.1 (/playground) error: expected expression, found `1 + 1` --> src/lib.rs:6:37 | 6 | (($p:pat, $e:pat)) => {let $p = $e;}; | ^^ expected expression ... 10 | test!(let x = 1+1); | ------------------- in this macro invocation error: aborting due to previous error error: could not compile `playground`. To learn more, run the command again with --verbose.
@rustbot modify labels to T-compiler, A-macros, C-enhancement, D-papercut, A-diagnostics
clarfonthey, ycd, lemosvncs and ssh352ChayimFriedman2
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, ..)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.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.