about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/suggestions/bool_typo_err_suggest.rs12
-rw-r--r--src/test/ui/suggestions/bool_typo_err_suggest.stderr25
2 files changed, 37 insertions, 0 deletions
diff --git a/src/test/ui/suggestions/bool_typo_err_suggest.rs b/src/test/ui/suggestions/bool_typo_err_suggest.rs
new file mode 100644
index 00000000000..deab0fb05b7
--- /dev/null
+++ b/src/test/ui/suggestions/bool_typo_err_suggest.rs
@@ -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
+}
diff --git a/src/test/ui/suggestions/bool_typo_err_suggest.stderr b/src/test/ui/suggestions/bool_typo_err_suggest.stderr
new file mode 100644
index 00000000000..52bde07ca07
--- /dev/null
+++ b/src/test/ui/suggestions/bool_typo_err_suggest.stderr
@@ -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`.