about summary refs log tree commit diff
diff options
context:
space:
mode:
authorcjkenn <cam.j.kennedy@gmail.com>2020-01-04 10:58:04 -0800
committercjkenn <cam.j.kennedy@gmail.com>2020-01-04 10:58:04 -0800
commite01e8b9256587a074968b440aa30d43b31642cb5 (patch)
treebef68aa74e6aac18d3d6c4c2a6ffc7141e97f8d9
parent27ea4c855e2adeeea9e5e58622715d45fd9c7801 (diff)
downloadrust-e01e8b9256587a074968b440aa30d43b31642cb5.tar.gz
rust-e01e8b9256587a074968b440aa30d43b31642cb5.zip
add ui test
-rw-r--r--src/test/ui/suggestions/issue-66968-suggest-sorted-words.rs4
-rw-r--r--src/test/ui/suggestions/issue-66968-suggest-sorted-words.stderr9
2 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/suggestions/issue-66968-suggest-sorted-words.rs b/src/test/ui/suggestions/issue-66968-suggest-sorted-words.rs
new file mode 100644
index 00000000000..440bb653a83
--- /dev/null
+++ b/src/test/ui/suggestions/issue-66968-suggest-sorted-words.rs
@@ -0,0 +1,4 @@
+fn main() {
+    let a_longer_variable_name = 1;
+    println!("{}", a_variable_longer_name); //~ ERROR E0425
+}
diff --git a/src/test/ui/suggestions/issue-66968-suggest-sorted-words.stderr b/src/test/ui/suggestions/issue-66968-suggest-sorted-words.stderr
new file mode 100644
index 00000000000..d7b33ea41f7
--- /dev/null
+++ b/src/test/ui/suggestions/issue-66968-suggest-sorted-words.stderr
@@ -0,0 +1,9 @@
+error[E0425]: cannot find value `a_variable_longer_name` in this scope
+  --> $DIR/issue-66968-suggest-sorted-words.rs:3:20
+   |
+LL |     println!("{}", a_variable_longer_name);
+   |                    ^^^^^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `a_longer_variable_name`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0425`.