From e01e8b9256587a074968b440aa30d43b31642cb5 Mon Sep 17 00:00:00 2001 From: cjkenn Date: Sat, 4 Jan 2020 10:58:04 -0800 Subject: [PATCH] add ui test --- .../ui/suggestions/issue-66968-suggest-sorted-words.rs | 4 ++++ .../suggestions/issue-66968-suggest-sorted-words.stderr | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 src/test/ui/suggestions/issue-66968-suggest-sorted-words.rs create mode 100644 src/test/ui/suggestions/issue-66968-suggest-sorted-words.stderr 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 0000000000000..440bb653a83c3 --- /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 0000000000000..d7b33ea41f79a --- /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`.