forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sugg: suggest the usage of boolean value when there is a typo in the …
…keyword Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
- Loading branch information
1 parent
dd01122
commit 69715c9
Showing
3 changed files
with
59 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Suggest the boolean value instead of emit a generic error that the value | ||
// True is not in the scope. | ||
|
||
fn main() { | ||
let x = True; | ||
//~^ ERROR cannot find value `True` in this scope | ||
//~| HELP you may want to use a bool value instead | ||
|
||
let y = False; | ||
//~^ ERROR cannot find value `False` in this scope | ||
//~| HELP you may want to use a bool value instead | ||
} |
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,25 @@ | ||
error[E0425]: cannot find value `True` in this scope | ||
--> $DIR/bool_typo_err_suggest.rs:5:13 | ||
| | ||
LL | let x = True; | ||
| ^^^^ not found in this scope | ||
| | ||
help: you may want to use a bool value instead | ||
| | ||
LL | let x = true; | ||
| ~~~~ | ||
|
||
error[E0425]: cannot find value `False` in this scope | ||
--> $DIR/bool_typo_err_suggest.rs:9:13 | ||
| | ||
LL | let y = False; | ||
| ^^^^^ not found in this scope | ||
| | ||
help: you may want to use a bool value instead | ||
| | ||
LL | let y = false; | ||
| ~~~~~ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0425`. |