-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
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
Code
fn main() {
let_some_variable = 6;
}Current output
error[E0425]: cannot find value `let_some_variable` in this scope
--> src/main.rs:2:5
|
2 | let_some_variable = 6;
| ^^^^^^^^^^^^^^^^^
|
help: you might have meant to introduce a new binding
|
2 | let let_some_variable = 6;
| +++Desired output
error[E0425]: cannot find value `let_some_variable` in this scope
--> src/main.rs:2:5
|
2 | let_some_variable = 6;
| ^^^^^^^^^^^^^^^^^
|
help: you might have meant to introduce a new binding
|
2 | let some_variable = 6;
| +Rationale and extra context
I accidentally typoed an underscore instead of a space between let and the name of the new variable I was trying to declare. If a binding isn't found, and it starts with let_ (or frankly letsome_variable, if you forget/miss the space completely), it seems like it would be more likely to suggest let (let plus a space) rather than the current suggestion of an additional let .
Other cases
No response
Anything else?
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.