-
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 ASTT-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
Code
The simplest reproduction would be something like this:
fn main() {
if 5 =< 3 {
println("True!");
}
}
Current output
error: expected type, found `3`
--> src/main.rs:2:13
|
2 | if 5 =< 3 {
| ^ expected type
Desired output
error: expected type, found `3`
--> src/main.rs:2:13
|
2 | if 5 =< 3 {
| ^ expected type
Note: If you want to compare for less or equal instead, use `<=`
- the `note points at the operator
Rationale and extra context
A new user might get confused about needing a type, as the error points at the number instead of the comparator.
Other cases
No response
Anything else?
No response
Piturnah, wackbyte, mo8it, Tiim, vringar and 2 more
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 ASTT-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.