-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTP-lowLow priorityLow priorityT-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
When encountering code like if 42 => 2 {}
, we currently emit
error: expected `{`, found `=>`
--> src/main.rs:2:10
|
2 | if 42 => 2 {}
| ^^ expected `{`
|
note: the `if` expression is missing a block after this condition
--> src/main.rs:2:7
|
2 | if 42 => 2 {}
| ^^
But it should be closer to
error: expected `{`, found `=>`
--> src/main.rs:2:10
|
2 | if 42 => 2 {}
| ^^ expected `{`
|
note: you likely meant to write a "greater than or equal to" comparison
--> src/main.rs:2:7
|
2 - if 42 => 2 {}
2 + if 42 >= 2 {}
|
gurry
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTP-lowLow priorityLow priorityT-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.