-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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
Given the following code (playground):
fn main() {
assert_eq!(1 + 2 == 3);
}
Current output: terse
error: unexpected end of macro invocation
--> src/main.rs:2:26
|
2 | assert_eq!(1 + 2 == 3);
| ^ missing tokens in macro arguments
Better output: show macro correspondence
note: This expression was treated as the $left argument to assert_eq!
|
2 | assert_eq!(1 + 2 == 3);
| ^^^^^^^^^^
note: Following $left, assert_eq! expects ","
(See also #97108, which also asks for more verbose "missing tokens in macro arguments" errors.)
Ideal output: fix my mistake
help: To assert equality, separate the two expressions with a comma:
|
2 | assert_eq!(1 + 2, 3);
| ^
(See also #57507, which asks for specific diagnostics when making a similar mistake with the assert!
macro.)
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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.