-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suggest fixing typos and let bindings at the same time
Fixes #132483
- Loading branch information
1 parent
7c7bb7d
commit 67a8592
Showing
4 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
fn main() { | ||
let x1 = 0; | ||
x2 = 1; | ||
//~^ ERROR E0425 | ||
other_val = 2; | ||
//~^ ERROR E0425 | ||
} |
29 changes: 29 additions & 0 deletions
29
tests/ui/suggestions/suggest-let-and-typo-issue-132483.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
error[E0425]: cannot find value `x2` in this scope | ||
--> $DIR/suggest-let-and-typo-issue-132483.rs:3:5 | ||
| | ||
LL | x2 = 1; | ||
| ^^ | ||
| | ||
help: a local variable with a similar name exists | ||
| | ||
LL | x1 = 1; | ||
| ~~ | ||
help: you might have meant to introduce a new binding | ||
| | ||
LL | let x2 = 1; | ||
| +++ | ||
|
||
error[E0425]: cannot find value `other_val` in this scope | ||
--> $DIR/suggest-let-and-typo-issue-132483.rs:5:5 | ||
| | ||
LL | other_val = 2; | ||
| ^^^^^^^^^ | ||
| | ||
help: you might have meant to introduce a new binding | ||
| | ||
LL | let other_val = 2; | ||
| +++ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0425`. |