about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/derived-errors/issue-31997-1.stderr9
-rw-r--r--src/test/ui/error-codes/E0433.rs2
-rw-r--r--src/test/ui/error-codes/E0433.stderr6
-rw-r--r--src/test/ui/hygiene/no_implicit_prelude.stderr8
-rw-r--r--src/test/ui/resolve/use_suggestion.rs7
-rw-r--r--src/test/ui/resolve/use_suggestion.stderr42
6 files changed, 68 insertions, 6 deletions
diff --git a/src/test/ui/derived-errors/issue-31997-1.stderr b/src/test/ui/derived-errors/issue-31997-1.stderr
index 6df748122a2..a4daf86cc8a 100644
--- a/src/test/ui/derived-errors/issue-31997-1.stderr
+++ b/src/test/ui/derived-errors/issue-31997-1.stderr
@@ -2,7 +2,14 @@ error[E0433]: failed to resolve: use of undeclared type or module `HashMap`
   --> $DIR/issue-31997-1.rs:20:19
    |
 LL |     let mut map = HashMap::new();
-   |                   ^^^^^^^ use of undeclared type or module `HashMap`
+   |                   ^^^^^^^ not found in this scope
+   |
+help: consider importing one of these items
+   |
+LL | use std::collections::HashMap;
+   |
+LL | use std::collections::hash_map::HashMap;
+   |
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/error-codes/E0433.rs b/src/test/ui/error-codes/E0433.rs
index 9b54ec8c5cf..d555e654263 100644
--- a/src/test/ui/error-codes/E0433.rs
+++ b/src/test/ui/error-codes/E0433.rs
@@ -1,3 +1,3 @@
 fn main () {
-    let map = HashMap::new(); //~ ERROR E0433
+    let map = NonExistingMap::new(); //~ ERROR E0433
 }
diff --git a/src/test/ui/error-codes/E0433.stderr b/src/test/ui/error-codes/E0433.stderr
index d852e188384..d9555e1fcf7 100644
--- a/src/test/ui/error-codes/E0433.stderr
+++ b/src/test/ui/error-codes/E0433.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared type or module `HashMap`
+error[E0433]: failed to resolve: use of undeclared type or module `NonExistingMap`
   --> $DIR/E0433.rs:2:15
    |
-LL |     let map = HashMap::new();
-   |               ^^^^^^^ use of undeclared type or module `HashMap`
+LL |     let map = NonExistingMap::new();
+   |               ^^^^^^^^^^^^^^ use of undeclared type or module `NonExistingMap`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/hygiene/no_implicit_prelude.stderr b/src/test/ui/hygiene/no_implicit_prelude.stderr
index 986671c7810..c0539434d02 100644
--- a/src/test/ui/hygiene/no_implicit_prelude.stderr
+++ b/src/test/ui/hygiene/no_implicit_prelude.stderr
@@ -13,9 +13,15 @@ LL |     fn f() { ::bar::m!(); }
    |              ------------ in this macro invocation
 ...
 LL |         Vec::new();
-   |         ^^^ use of undeclared type or module `Vec`
+   |         ^^^ not found in this scope
    |
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing one of these items
+   |
+LL |     use std::prelude::v1::Vec;
+   |
+LL |     use std::vec::Vec;
+   |
 
 error[E0599]: no method named `clone` found for unit type `()` in the current scope
   --> $DIR/no_implicit_prelude.rs:12:12
diff --git a/src/test/ui/resolve/use_suggestion.rs b/src/test/ui/resolve/use_suggestion.rs
new file mode 100644
index 00000000000..8c9bc6d76b8
--- /dev/null
+++ b/src/test/ui/resolve/use_suggestion.rs
@@ -0,0 +1,7 @@
+fn main() {
+    let x1 = HashMap::new(); //~ ERROR failed to resolve
+    let x2 = GooMap::new(); //~ ERROR failed to resolve
+
+    let y1: HashMap; //~ ERROR cannot find type
+    let y2: GooMap; //~ ERROR cannot find type
+}
diff --git a/src/test/ui/resolve/use_suggestion.stderr b/src/test/ui/resolve/use_suggestion.stderr
new file mode 100644
index 00000000000..2fd3d5dccd2
--- /dev/null
+++ b/src/test/ui/resolve/use_suggestion.stderr
@@ -0,0 +1,42 @@
+error[E0433]: failed to resolve: use of undeclared type or module `GooMap`
+  --> $DIR/use_suggestion.rs:3:14
+   |
+LL |     let x2 = GooMap::new();
+   |              ^^^^^^ use of undeclared type or module `GooMap`
+
+error[E0433]: failed to resolve: use of undeclared type or module `HashMap`
+  --> $DIR/use_suggestion.rs:2:14
+   |
+LL |     let x1 = HashMap::new();
+   |              ^^^^^^^ not found in this scope
+   |
+help: consider importing one of these items
+   |
+LL | use std::collections::HashMap;
+   |
+LL | use std::collections::hash_map::HashMap;
+   |
+
+error[E0412]: cannot find type `HashMap` in this scope
+  --> $DIR/use_suggestion.rs:5:13
+   |
+LL |     let y1: HashMap;
+   |             ^^^^^^^ not found in this scope
+   |
+help: consider importing one of these items
+   |
+LL | use std::collections::HashMap;
+   |
+LL | use std::collections::hash_map::HashMap;
+   |
+
+error[E0412]: cannot find type `GooMap` in this scope
+  --> $DIR/use_suggestion.rs:6:13
+   |
+LL |     let y2: GooMap;
+   |             ^^^^^^ not found in this scope
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0412, E0433.
+For more information about an error, try `rustc --explain E0412`.