about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKornel <kornel@geekhood.net>2020-08-27 13:27:14 +0100
committerKornel <kornel@geekhood.net>2020-09-01 18:38:14 +0100
commit7ec1de062a1aadef0293bb65e71fbcc7cc24ebfd (patch)
tree62d30e2e0f31039bdb4abeb31ec474359e85df42
parent397db054cb1f3d98e3d2809d25c60f1979cd5a97 (diff)
downloadrust-7ec1de062a1aadef0293bb65e71fbcc7cc24ebfd.tar.gz
rust-7ec1de062a1aadef0293bb65e71fbcc7cc24ebfd.zip
Clarify message about unresolved use
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0433.md16
-rw-r--r--compiler/rustc_resolve/src/lib.rs9
-rw-r--r--src/test/ui/attributes/register-attr-tool-prelude.rs2
-rw-r--r--src/test/ui/attributes/register-attr-tool-prelude.stderr4
-rw-r--r--src/test/ui/bad/bad-module.rs4
-rw-r--r--src/test/ui/bad/bad-module.stderr8
-rw-r--r--src/test/ui/coherence/conflicting-impl-with-err.stderr8
-rw-r--r--src/test/ui/derived-errors/issue-31997-1.stderr2
-rw-r--r--src/test/ui/dyn-trait-compatibility.rs4
-rw-r--r--src/test/ui/dyn-trait-compatibility.stderr8
-rw-r--r--src/test/ui/error-codes/E0433.stderr4
-rw-r--r--src/test/ui/export-fully-qualified.rs4
-rw-r--r--src/test/ui/export-fully-qualified.stderr6
-rw-r--r--src/test/ui/export2.rs2
-rw-r--r--src/test/ui/export2.stderr4
-rw-r--r--src/test/ui/extern-flag/multiple-opts.stderr4
-rw-r--r--src/test/ui/extern-flag/noprelude.stderr4
-rw-r--r--src/test/ui/hygiene/extern-prelude-from-opaque-fail.rs4
-rw-r--r--src/test/ui/hygiene/extern-prelude-from-opaque-fail.stderr8
-rw-r--r--src/test/ui/hygiene/no_implicit_prelude.stderr2
-rw-r--r--src/test/ui/impl-trait/issue-72911.stderr8
-rw-r--r--src/test/ui/imports/extern-prelude-extern-crate-fail.rs4
-rw-r--r--src/test/ui/imports/extern-prelude-extern-crate-fail.stderr8
-rw-r--r--src/test/ui/issues/issue-33293.rs2
-rw-r--r--src/test/ui/issues/issue-33293.stderr4
-rw-r--r--src/test/ui/macros/builtin-prelude-no-accidents.rs6
-rw-r--r--src/test/ui/macros/builtin-prelude-no-accidents.stderr12
-rw-r--r--src/test/ui/macros/macro-inner-attributes.rs2
-rw-r--r--src/test/ui/macros/macro-inner-attributes.stderr4
-rw-r--r--src/test/ui/macros/macro_path_as_generic_bound.stderr4
-rw-r--r--src/test/ui/mod/mod_file_disambig.rs2
-rw-r--r--src/test/ui/mod/mod_file_disambig.stderr4
-rw-r--r--src/test/ui/parser/mod_file_not_exist.rs2
-rw-r--r--src/test/ui/parser/mod_file_not_exist.stderr4
-rw-r--r--src/test/ui/parser/mod_file_not_exist_windows.rs2
-rw-r--r--src/test/ui/parser/mod_file_not_exist_windows.stderr4
-rw-r--r--src/test/ui/pattern/pattern-error-continue.rs2
-rw-r--r--src/test/ui/pattern/pattern-error-continue.stderr4
-rw-r--r--src/test/ui/resolve/use_suggestion.stderr6
-rw-r--r--src/test/ui/rfc-2126-extern-absolute-paths/non-existent-1.stderr2
-rw-r--r--src/test/ui/suggestions/type-ascription-instead-of-path.rs2
-rw-r--r--src/test/ui/suggestions/type-ascription-instead-of-path.stderr4
-rw-r--r--src/test/ui/type-alias/issue-62263-self-in-atb.rs2
-rw-r--r--src/test/ui/type-alias/issue-62263-self-in-atb.stderr4
-rw-r--r--src/test/ui/type-alias/issue-62305-self-assoc-ty.rs2
-rw-r--r--src/test/ui/type-alias/issue-62305-self-assoc-ty.stderr4
-rw-r--r--src/test/ui/type/type-path-err-node-types.rs2
-rw-r--r--src/test/ui/type/type-path-err-node-types.stderr4
-rw-r--r--src/test/ui/unknown-tool-name.rs2
-rw-r--r--src/test/ui/unknown-tool-name.stderr4
-rw-r--r--src/test/ui/use/use-self-type.rs2
-rw-r--r--src/test/ui/use/use-self-type.stderr6
52 files changed, 126 insertions, 105 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0433.md b/compiler/rustc_error_codes/src/error_codes/E0433.md
index f9e333e8ccd..5a64c13c9af 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0433.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0433.md
@@ -1,17 +1,27 @@
-An undeclared type or module was used.
+An undeclared crate, module, or type was used.
 
 Erroneous code example:
 
 ```compile_fail,E0433
 let map = HashMap::new();
-// error: failed to resolve: use of undeclared type or module `HashMap`
+// error: failed to resolve: use of undeclared type `HashMap`
 ```
 
 Please verify you didn't misspell the type/module's name or that you didn't
 forget to import it:
 
-
 ```
 use std::collections::HashMap; // HashMap has been imported.
 let map: HashMap<u32, u32> = HashMap::new(); // So it can be used!
 ```
+
+If you've expected to use a crate name:
+
+```compile_fail
+use ferris_wheel::BigO;
+// error: failed to resolve: use of undeclared crate or module `ferris_wheel`
+```
+
+Make sure the crate has been added as a dependency in `Cargo.toml`.
+
+To use a module from your current crate, add the `crate::` prefix to the path.
diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs
index 5892edf7652..4c06249f779 100644
--- a/compiler/rustc_resolve/src/lib.rs
+++ b/compiler/rustc_resolve/src/lib.rs
@@ -2407,7 +2407,14 @@ impl<'a> Resolver<'a> {
                             (format!("maybe a missing crate `{}`?", ident), None)
                         }
                     } else if i == 0 {
-                        (format!("use of undeclared type or module `{}`", ident), None)
+                        if ident
+                            .name
+                            .with(|n| n.chars().next().map_or(false, |c| c.is_ascii_uppercase()))
+                        {
+                            (format!("use of undeclared type `{}`", ident), None)
+                        } else {
+                            (format!("use of undeclared crate or module `{}`", ident), None)
+                        }
                     } else {
                         let mut msg =
                             format!("could not find `{}` in `{}`", ident, path[i - 1].ident);
diff --git a/src/test/ui/attributes/register-attr-tool-prelude.rs b/src/test/ui/attributes/register-attr-tool-prelude.rs
index a491773f5eb..d217a8146d2 100644
--- a/src/test/ui/attributes/register-attr-tool-prelude.rs
+++ b/src/test/ui/attributes/register-attr-tool-prelude.rs
@@ -7,7 +7,7 @@
 #[no_implicit_prelude]
 mod m {
     #[attr] //~ ERROR cannot find attribute `attr` in this scope
-    #[tool::attr] //~ ERROR failed to resolve: use of undeclared type or module `tool`
+    #[tool::attr] //~ ERROR failed to resolve: use of undeclared crate or module `tool`
     fn check() {}
 }
 
diff --git a/src/test/ui/attributes/register-attr-tool-prelude.stderr b/src/test/ui/attributes/register-attr-tool-prelude.stderr
index 66a4eeb6aa4..905b661206a 100644
--- a/src/test/ui/attributes/register-attr-tool-prelude.stderr
+++ b/src/test/ui/attributes/register-attr-tool-prelude.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared type or module `tool`
+error[E0433]: failed to resolve: use of undeclared crate or module `tool`
   --> $DIR/register-attr-tool-prelude.rs:10:7
    |
 LL |     #[tool::attr]
-   |       ^^^^ use of undeclared type or module `tool`
+   |       ^^^^ use of undeclared crate or module `tool`
 
 error: cannot find attribute `attr` in this scope
   --> $DIR/register-attr-tool-prelude.rs:9:7
diff --git a/src/test/ui/bad/bad-module.rs b/src/test/ui/bad/bad-module.rs
index a496c816e94..b23e97c2cf6 100644
--- a/src/test/ui/bad/bad-module.rs
+++ b/src/test/ui/bad/bad-module.rs
@@ -1,7 +1,7 @@
 fn main() {
     let foo = thing::len(Vec::new());
-    //~^ ERROR failed to resolve: use of undeclared type or module `thing`
+    //~^ ERROR failed to resolve: use of undeclared crate or module `thing`
 
     let foo = foo::bar::baz();
-    //~^ ERROR failed to resolve: use of undeclared type or module `foo`
+    //~^ ERROR failed to resolve: use of undeclared crate or module `foo`
 }
diff --git a/src/test/ui/bad/bad-module.stderr b/src/test/ui/bad/bad-module.stderr
index 45d4c5abd93..581a6619814 100644
--- a/src/test/ui/bad/bad-module.stderr
+++ b/src/test/ui/bad/bad-module.stderr
@@ -1,14 +1,14 @@
-error[E0433]: failed to resolve: use of undeclared type or module `thing`
+error[E0433]: failed to resolve: use of undeclared crate or module `thing`
   --> $DIR/bad-module.rs:2:15
    |
 LL |     let foo = thing::len(Vec::new());
-   |               ^^^^^ use of undeclared type or module `thing`
+   |               ^^^^^ use of undeclared crate or module `thing`
 
-error[E0433]: failed to resolve: use of undeclared type or module `foo`
+error[E0433]: failed to resolve: use of undeclared crate or module `foo`
   --> $DIR/bad-module.rs:5:15
    |
 LL |     let foo = foo::bar::baz();
-   |               ^^^ use of undeclared type or module `foo`
+   |               ^^^ use of undeclared crate or module `foo`
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/coherence/conflicting-impl-with-err.stderr b/src/test/ui/coherence/conflicting-impl-with-err.stderr
index a8a5730accd..3009b452dc7 100644
--- a/src/test/ui/coherence/conflicting-impl-with-err.stderr
+++ b/src/test/ui/coherence/conflicting-impl-with-err.stderr
@@ -1,14 +1,14 @@
-error[E0433]: failed to resolve: use of undeclared type or module `nope`
+error[E0433]: failed to resolve: use of undeclared crate or module `nope`
   --> $DIR/conflicting-impl-with-err.rs:4:11
    |
 LL | impl From<nope::Thing> for Error {
-   |           ^^^^ use of undeclared type or module `nope`
+   |           ^^^^ use of undeclared crate or module `nope`
 
-error[E0433]: failed to resolve: use of undeclared type or module `nope`
+error[E0433]: failed to resolve: use of undeclared crate or module `nope`
   --> $DIR/conflicting-impl-with-err.rs:5:16
    |
 LL |     fn from(_: nope::Thing) -> Self {
-   |                ^^^^ use of undeclared type or module `nope`
+   |                ^^^^ use of undeclared crate or module `nope`
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/derived-errors/issue-31997-1.stderr b/src/test/ui/derived-errors/issue-31997-1.stderr
index 229c5c9e80f..6d177666ed0 100644
--- a/src/test/ui/derived-errors/issue-31997-1.stderr
+++ b/src/test/ui/derived-errors/issue-31997-1.stderr
@@ -1,4 +1,4 @@
-error[E0433]: failed to resolve: use of undeclared type or module `HashMap`
+error[E0433]: failed to resolve: use of undeclared type `HashMap`
   --> $DIR/issue-31997-1.rs:20:19
    |
 LL |     let mut map = HashMap::new();
diff --git a/src/test/ui/dyn-trait-compatibility.rs b/src/test/ui/dyn-trait-compatibility.rs
index 2a1cea6c348..d2b02cc2af5 100644
--- a/src/test/ui/dyn-trait-compatibility.rs
+++ b/src/test/ui/dyn-trait-compatibility.rs
@@ -1,7 +1,7 @@
 type A0 = dyn;
 //~^ ERROR cannot find type `dyn` in this scope
 type A1 = dyn::dyn;
-//~^ ERROR use of undeclared type or module `dyn`
+//~^ ERROR use of undeclared crate or module `dyn`
 type A2 = dyn<dyn, dyn>;
 //~^ ERROR cannot find type `dyn` in this scope
 //~| ERROR cannot find type `dyn` in this scope
@@ -9,6 +9,6 @@ type A2 = dyn<dyn, dyn>;
 type A3 = dyn<<dyn as dyn>::dyn>;
 //~^ ERROR cannot find type `dyn` in this scope
 //~| ERROR cannot find type `dyn` in this scope
-//~| ERROR use of undeclared type or module `dyn`
+//~| ERROR use of undeclared crate or module `dyn`
 
 fn main() {}
diff --git a/src/test/ui/dyn-trait-compatibility.stderr b/src/test/ui/dyn-trait-compatibility.stderr
index 8fe8ceb4d0a..9218ae9d5da 100644
--- a/src/test/ui/dyn-trait-compatibility.stderr
+++ b/src/test/ui/dyn-trait-compatibility.stderr
@@ -1,14 +1,14 @@
-error[E0433]: failed to resolve: use of undeclared type or module `dyn`
+error[E0433]: failed to resolve: use of undeclared crate or module `dyn`
   --> $DIR/dyn-trait-compatibility.rs:3:11
    |
 LL | type A1 = dyn::dyn;
-   |           ^^^ use of undeclared type or module `dyn`
+   |           ^^^ use of undeclared crate or module `dyn`
 
-error[E0433]: failed to resolve: use of undeclared type or module `dyn`
+error[E0433]: failed to resolve: use of undeclared crate or module `dyn`
   --> $DIR/dyn-trait-compatibility.rs:9:23
    |
 LL | type A3 = dyn<<dyn as dyn>::dyn>;
-   |                       ^^^ use of undeclared type or module `dyn`
+   |                       ^^^ use of undeclared crate or module `dyn`
 
 error[E0412]: cannot find type `dyn` in this scope
   --> $DIR/dyn-trait-compatibility.rs:1:11
diff --git a/src/test/ui/error-codes/E0433.stderr b/src/test/ui/error-codes/E0433.stderr
index d9555e1fcf7..265d8885c8d 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 `NonExistingMap`
+error[E0433]: failed to resolve: use of undeclared type `NonExistingMap`
   --> $DIR/E0433.rs:2:15
    |
 LL |     let map = NonExistingMap::new();
-   |               ^^^^^^^^^^^^^^ use of undeclared type or module `NonExistingMap`
+   |               ^^^^^^^^^^^^^^ use of undeclared type `NonExistingMap`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/export-fully-qualified.rs b/src/test/ui/export-fully-qualified.rs
index 99cb558908c..40f26c7095f 100644
--- a/src/test/ui/export-fully-qualified.rs
+++ b/src/test/ui/export-fully-qualified.rs
@@ -1,9 +1,11 @@
+// ignore-tidy-linelength
+
 // In this test baz isn't resolved when called as foo.baz even though
 // it's called from inside foo. This is somewhat surprising and may
 // want to change eventually.
 
 mod foo {
-    pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of undeclared type or module `foo`
+    pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of undeclared crate or module `foo`
 
     fn baz() { }
 }
diff --git a/src/test/ui/export-fully-qualified.stderr b/src/test/ui/export-fully-qualified.stderr
index c2ec1600868..a8af0c7c9b8 100644
--- a/src/test/ui/export-fully-qualified.stderr
+++ b/src/test/ui/export-fully-qualified.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared type or module `foo`
-  --> $DIR/export-fully-qualified.rs:6:20
+error[E0433]: failed to resolve: use of undeclared crate or module `foo`
+  --> $DIR/export-fully-qualified.rs:8:20
    |
 LL |     pub fn bar() { foo::baz(); }
-   |                    ^^^ use of undeclared type or module `foo`
+   |                    ^^^ use of undeclared crate or module `foo`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/export2.rs b/src/test/ui/export2.rs
index 811d96f26d0..64ebeddffa8 100644
--- a/src/test/ui/export2.rs
+++ b/src/test/ui/export2.rs
@@ -1,5 +1,5 @@
 mod foo {
-    pub fn x() { bar::x(); } //~ ERROR failed to resolve: use of undeclared type or module `bar`
+    pub fn x() { bar::x(); } //~ ERROR failed to resolve: use of undeclared crate or module `bar`
 }
 
 mod bar {
diff --git a/src/test/ui/export2.stderr b/src/test/ui/export2.stderr
index e0cd4404d37..7cf47d0764b 100644
--- a/src/test/ui/export2.stderr
+++ b/src/test/ui/export2.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared type or module `bar`
+error[E0433]: failed to resolve: use of undeclared crate or module `bar`
   --> $DIR/export2.rs:2:18
    |
 LL |     pub fn x() { bar::x(); }
-   |                  ^^^ use of undeclared type or module `bar`
+   |                  ^^^ use of undeclared crate or module `bar`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/extern-flag/multiple-opts.stderr b/src/test/ui/extern-flag/multiple-opts.stderr
index 3bf73d11cfd..5088fb1c4d2 100644
--- a/src/test/ui/extern-flag/multiple-opts.stderr
+++ b/src/test/ui/extern-flag/multiple-opts.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared type or module `somedep`
+error[E0433]: failed to resolve: use of undeclared crate or module `somedep`
   --> $DIR/multiple-opts.rs:19:5
    |
 LL |     somedep::somefun();
-   |     ^^^^^^^ use of undeclared type or module `somedep`
+   |     ^^^^^^^ use of undeclared crate or module `somedep`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/extern-flag/noprelude.stderr b/src/test/ui/extern-flag/noprelude.stderr
index beb9200ddda..57878721683 100644
--- a/src/test/ui/extern-flag/noprelude.stderr
+++ b/src/test/ui/extern-flag/noprelude.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared type or module `somedep`
+error[E0433]: failed to resolve: use of undeclared crate or module `somedep`
   --> $DIR/noprelude.rs:6:5
    |
 LL |     somedep::somefun();
-   |     ^^^^^^^ use of undeclared type or module `somedep`
+   |     ^^^^^^^ use of undeclared crate or module `somedep`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/hygiene/extern-prelude-from-opaque-fail.rs b/src/test/ui/hygiene/extern-prelude-from-opaque-fail.rs
index 06d62656e95..571017df4d7 100644
--- a/src/test/ui/hygiene/extern-prelude-from-opaque-fail.rs
+++ b/src/test/ui/hygiene/extern-prelude-from-opaque-fail.rs
@@ -9,7 +9,7 @@ macro a() {
     mod u {
         // Late resolution.
         fn f() { my_core::mem::drop(0); }
-        //~^ ERROR failed to resolve: use of undeclared type or module `my_core`
+        //~^ ERROR failed to resolve: use of undeclared crate or module `my_core`
     }
 }
 
@@ -22,7 +22,7 @@ mod v {
 mod u {
     // Late resolution.
     fn f() { my_core::mem::drop(0); }
-    //~^ ERROR failed to resolve: use of undeclared type or module `my_core`
+    //~^ ERROR failed to resolve: use of undeclared crate or module `my_core`
 }
 
 fn main() {}
diff --git a/src/test/ui/hygiene/extern-prelude-from-opaque-fail.stderr b/src/test/ui/hygiene/extern-prelude-from-opaque-fail.stderr
index b9e05c84a8a..d3e6021a1ed 100644
--- a/src/test/ui/hygiene/extern-prelude-from-opaque-fail.stderr
+++ b/src/test/ui/hygiene/extern-prelude-from-opaque-fail.stderr
@@ -18,22 +18,22 @@ LL | a!();
    |
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0433]: failed to resolve: use of undeclared type or module `my_core`
+error[E0433]: failed to resolve: use of undeclared crate or module `my_core`
   --> $DIR/extern-prelude-from-opaque-fail.rs:11:18
    |
 LL |         fn f() { my_core::mem::drop(0); }
-   |                  ^^^^^^^ use of undeclared type or module `my_core`
+   |                  ^^^^^^^ use of undeclared crate or module `my_core`
 ...
 LL | a!();
    | ----- in this macro invocation
    |
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0433]: failed to resolve: use of undeclared type or module `my_core`
+error[E0433]: failed to resolve: use of undeclared crate or module `my_core`
   --> $DIR/extern-prelude-from-opaque-fail.rs:24:14
    |
 LL |     fn f() { my_core::mem::drop(0); }
-   |              ^^^^^^^ use of undeclared type or module `my_core`
+   |              ^^^^^^^ use of undeclared crate or module `my_core`
 
 error: aborting due to 4 previous errors
 
diff --git a/src/test/ui/hygiene/no_implicit_prelude.stderr b/src/test/ui/hygiene/no_implicit_prelude.stderr
index 990210ffb6b..3c0c0450774 100644
--- a/src/test/ui/hygiene/no_implicit_prelude.stderr
+++ b/src/test/ui/hygiene/no_implicit_prelude.stderr
@@ -6,7 +6,7 @@ LL |         assert_eq!(0, 0);
    |
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0433]: failed to resolve: use of undeclared type or module `Vec`
+error[E0433]: failed to resolve: use of undeclared type `Vec`
   --> $DIR/no_implicit_prelude.rs:11:9
    |
 LL |     fn f() { ::bar::m!(); }
diff --git a/src/test/ui/impl-trait/issue-72911.stderr b/src/test/ui/impl-trait/issue-72911.stderr
index b28142b916c..5303a253a93 100644
--- a/src/test/ui/impl-trait/issue-72911.stderr
+++ b/src/test/ui/impl-trait/issue-72911.stderr
@@ -1,14 +1,14 @@
-error[E0433]: failed to resolve: use of undeclared type or module `foo`
+error[E0433]: failed to resolve: use of undeclared crate or module `foo`
   --> $DIR/issue-72911.rs:12:33
    |
 LL | fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator<Item = Lint> {
-   |                                 ^^^ use of undeclared type or module `foo`
+   |                                 ^^^ use of undeclared crate or module `foo`
 
-error[E0433]: failed to resolve: use of undeclared type or module `foo`
+error[E0433]: failed to resolve: use of undeclared crate or module `foo`
   --> $DIR/issue-72911.rs:17:41
    |
 LL | fn lint_files() -> impl Iterator<Item = foo::MissingItem> {
-   |                                         ^^^ use of undeclared type or module `foo`
+   |                                         ^^^ use of undeclared crate or module `foo`
 
 error[E0720]: cannot resolve opaque type
   --> $DIR/issue-72911.rs:7:24
diff --git a/src/test/ui/imports/extern-prelude-extern-crate-fail.rs b/src/test/ui/imports/extern-prelude-extern-crate-fail.rs
index 6b70efe0c44..4a0c6120201 100644
--- a/src/test/ui/imports/extern-prelude-extern-crate-fail.rs
+++ b/src/test/ui/imports/extern-prelude-extern-crate-fail.rs
@@ -1,3 +1,5 @@
+// ignore-tidy-linelength
+
 // aux-build:two_macros.rs
 // compile-flags:--extern non_existent
 
@@ -7,7 +9,7 @@ mod n {
 
 mod m {
     fn check() {
-        two_macros::m!(); //~ ERROR failed to resolve: use of undeclared type or module `two_macros`
+        two_macros::m!(); //~ ERROR failed to resolve: use of undeclared crate or module `two_macros`
     }
 }
 
diff --git a/src/test/ui/imports/extern-prelude-extern-crate-fail.stderr b/src/test/ui/imports/extern-prelude-extern-crate-fail.stderr
index f7544306d34..2d7a1bf468e 100644
--- a/src/test/ui/imports/extern-prelude-extern-crate-fail.stderr
+++ b/src/test/ui/imports/extern-prelude-extern-crate-fail.stderr
@@ -1,5 +1,5 @@
 error: macro-expanded `extern crate` items cannot shadow names passed with `--extern`
-  --> $DIR/extern-prelude-extern-crate-fail.rs:16:9
+  --> $DIR/extern-prelude-extern-crate-fail.rs:18:9
    |
 LL |         extern crate std as non_existent;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,11 +9,11 @@ LL | define_std_as_non_existent!();
    |
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0433]: failed to resolve: use of undeclared type or module `two_macros`
-  --> $DIR/extern-prelude-extern-crate-fail.rs:10:9
+error[E0433]: failed to resolve: use of undeclared crate or module `two_macros`
+  --> $DIR/extern-prelude-extern-crate-fail.rs:12:9
    |
 LL |         two_macros::m!();
-   |         ^^^^^^^^^^ use of undeclared type or module `two_macros`
+   |         ^^^^^^^^^^ use of undeclared crate or module `two_macros`
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/issues/issue-33293.rs b/src/test/ui/issues/issue-33293.rs
index d3670374284..a6ef007d51f 100644
--- a/src/test/ui/issues/issue-33293.rs
+++ b/src/test/ui/issues/issue-33293.rs
@@ -1,6 +1,6 @@
 fn main() {
     match 0 {
         aaa::bbb(_) => ()
-        //~^ ERROR failed to resolve: use of undeclared type or module `aaa`
+        //~^ ERROR failed to resolve: use of undeclared crate or module `aaa`
     };
 }
diff --git a/src/test/ui/issues/issue-33293.stderr b/src/test/ui/issues/issue-33293.stderr
index 6b7333f22fe..c8450f40042 100644
--- a/src/test/ui/issues/issue-33293.stderr
+++ b/src/test/ui/issues/issue-33293.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared type or module `aaa`
+error[E0433]: failed to resolve: use of undeclared crate or module `aaa`
   --> $DIR/issue-33293.rs:3:9
    |
 LL |         aaa::bbb(_) => ()
-   |         ^^^ use of undeclared type or module `aaa`
+   |         ^^^ use of undeclared crate or module `aaa`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/macros/builtin-prelude-no-accidents.rs b/src/test/ui/macros/builtin-prelude-no-accidents.rs
index ac82f343acc..01691a82dd7 100644
--- a/src/test/ui/macros/builtin-prelude-no-accidents.rs
+++ b/src/test/ui/macros/builtin-prelude-no-accidents.rs
@@ -2,7 +2,7 @@
 // because macros with the same names are in prelude.
 
 fn main() {
-    env::current_dir; //~ ERROR use of undeclared type or module `env`
-    type A = panic::PanicInfo; //~ ERROR use of undeclared type or module `panic`
-    type B = vec::Vec<u8>; //~ ERROR use of undeclared type or module `vec`
+    env::current_dir; //~ ERROR use of undeclared crate or module `env`
+    type A = panic::PanicInfo; //~ ERROR use of undeclared crate or module `panic`
+    type B = vec::Vec<u8>; //~ ERROR use of undeclared crate or module `vec`
 }
diff --git a/src/test/ui/macros/builtin-prelude-no-accidents.stderr b/src/test/ui/macros/builtin-prelude-no-accidents.stderr
index 914e906df58..56af618d484 100644
--- a/src/test/ui/macros/builtin-prelude-no-accidents.stderr
+++ b/src/test/ui/macros/builtin-prelude-no-accidents.stderr
@@ -1,20 +1,20 @@
-error[E0433]: failed to resolve: use of undeclared type or module `env`
+error[E0433]: failed to resolve: use of undeclared crate or module `env`
   --> $DIR/builtin-prelude-no-accidents.rs:5:5
    |
 LL |     env::current_dir;
-   |     ^^^ use of undeclared type or module `env`
+   |     ^^^ use of undeclared crate or module `env`
 
-error[E0433]: failed to resolve: use of undeclared type or module `panic`
+error[E0433]: failed to resolve: use of undeclared crate or module `panic`
   --> $DIR/builtin-prelude-no-accidents.rs:6:14
    |
 LL |     type A = panic::PanicInfo;
-   |              ^^^^^ use of undeclared type or module `panic`
+   |              ^^^^^ use of undeclared crate or module `panic`
 
-error[E0433]: failed to resolve: use of undeclared type or module `vec`
+error[E0433]: failed to resolve: use of undeclared crate or module `vec`
   --> $DIR/builtin-prelude-no-accidents.rs:7:14
    |
 LL |     type B = vec::Vec<u8>;
-   |              ^^^ use of undeclared type or module `vec`
+   |              ^^^ use of undeclared crate or module `vec`
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/macros/macro-inner-attributes.rs b/src/test/ui/macros/macro-inner-attributes.rs
index 56a90231566..a8cda23075b 100644
--- a/src/test/ui/macros/macro-inner-attributes.rs
+++ b/src/test/ui/macros/macro-inner-attributes.rs
@@ -15,6 +15,6 @@ test!(b,
 #[rustc_dummy]
 fn main() {
     a::bar();
-    //~^ ERROR failed to resolve: use of undeclared type or module `a`
+    //~^ ERROR failed to resolve: use of undeclared crate or module `a`
     b::bar();
 }
diff --git a/src/test/ui/macros/macro-inner-attributes.stderr b/src/test/ui/macros/macro-inner-attributes.stderr
index 5e20f106a95..8223220d9a4 100644
--- a/src/test/ui/macros/macro-inner-attributes.stderr
+++ b/src/test/ui/macros/macro-inner-attributes.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared type or module `a`
+error[E0433]: failed to resolve: use of undeclared crate or module `a`
   --> $DIR/macro-inner-attributes.rs:17:5
    |
 LL |     a::bar();
-   |     ^ use of undeclared type or module `a`
+   |     ^ use of undeclared crate or module `a`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/macros/macro_path_as_generic_bound.stderr b/src/test/ui/macros/macro_path_as_generic_bound.stderr
index 48c33575ad2..00d954d24f3 100644
--- a/src/test/ui/macros/macro_path_as_generic_bound.stderr
+++ b/src/test/ui/macros/macro_path_as_generic_bound.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared type or module `m`
+error[E0433]: failed to resolve: use of undeclared crate or module `m`
   --> $DIR/macro_path_as_generic_bound.rs:7:6
    |
 LL | foo!(m::m2::A);
-   |      ^ use of undeclared type or module `m`
+   |      ^ use of undeclared crate or module `m`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/mod/mod_file_disambig.rs b/src/test/ui/mod/mod_file_disambig.rs
index 7b182421d34..e5958af173b 100644
--- a/src/test/ui/mod/mod_file_disambig.rs
+++ b/src/test/ui/mod/mod_file_disambig.rs
@@ -2,5 +2,5 @@ mod mod_file_disambig_aux; //~ ERROR file for module `mod_file_disambig_aux` fou
 
 fn main() {
     assert_eq!(mod_file_aux::bar(), 10);
-    //~^ ERROR failed to resolve: use of undeclared type or module `mod_file_aux`
+    //~^ ERROR failed to resolve: use of undeclared crate or module `mod_file_aux`
 }
diff --git a/src/test/ui/mod/mod_file_disambig.stderr b/src/test/ui/mod/mod_file_disambig.stderr
index 2cb99b75142..3a3d2e2dddd 100644
--- a/src/test/ui/mod/mod_file_disambig.stderr
+++ b/src/test/ui/mod/mod_file_disambig.stderr
@@ -6,11 +6,11 @@ LL | mod mod_file_disambig_aux;
    |
    = help: delete or rename one of them to remove the ambiguity
 
-error[E0433]: failed to resolve: use of undeclared type or module `mod_file_aux`
+error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux`
   --> $DIR/mod_file_disambig.rs:4:16
    |
 LL |     assert_eq!(mod_file_aux::bar(), 10);
-   |                ^^^^^^^^^^^^ use of undeclared type or module `mod_file_aux`
+   |                ^^^^^^^^^^^^ use of undeclared crate or module `mod_file_aux`
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/parser/mod_file_not_exist.rs b/src/test/ui/parser/mod_file_not_exist.rs
index f4a27b52ec5..7b079eb02dc 100644
--- a/src/test/ui/parser/mod_file_not_exist.rs
+++ b/src/test/ui/parser/mod_file_not_exist.rs
@@ -5,5 +5,5 @@ mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
 
 fn main() {
     assert_eq!(mod_file_aux::bar(), 10);
-    //~^ ERROR failed to resolve: use of undeclared type or module `mod_file_aux`
+    //~^ ERROR failed to resolve: use of undeclared crate or module `mod_file_aux`
 }
diff --git a/src/test/ui/parser/mod_file_not_exist.stderr b/src/test/ui/parser/mod_file_not_exist.stderr
index 087ae9fe3e0..4e08125625f 100644
--- a/src/test/ui/parser/mod_file_not_exist.stderr
+++ b/src/test/ui/parser/mod_file_not_exist.stderr
@@ -6,11 +6,11 @@ LL | mod not_a_real_file;
    |
    = help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs"
 
-error[E0433]: failed to resolve: use of undeclared type or module `mod_file_aux`
+error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux`
   --> $DIR/mod_file_not_exist.rs:7:16
    |
 LL |     assert_eq!(mod_file_aux::bar(), 10);
-   |                ^^^^^^^^^^^^ use of undeclared type or module `mod_file_aux`
+   |                ^^^^^^^^^^^^ use of undeclared crate or module `mod_file_aux`
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/parser/mod_file_not_exist_windows.rs b/src/test/ui/parser/mod_file_not_exist_windows.rs
index 4b7d7a02bbe..5db21e2bbc7 100644
--- a/src/test/ui/parser/mod_file_not_exist_windows.rs
+++ b/src/test/ui/parser/mod_file_not_exist_windows.rs
@@ -5,5 +5,5 @@ mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
 
 fn main() {
     assert_eq!(mod_file_aux::bar(), 10);
-    //~^ ERROR failed to resolve: use of undeclared type or module `mod_file_aux`
+    //~^ ERROR failed to resolve: use of undeclared crate or module `mod_file_aux`
 }
diff --git a/src/test/ui/parser/mod_file_not_exist_windows.stderr b/src/test/ui/parser/mod_file_not_exist_windows.stderr
index d67205cfdf1..73cdf098b00 100644
--- a/src/test/ui/parser/mod_file_not_exist_windows.stderr
+++ b/src/test/ui/parser/mod_file_not_exist_windows.stderr
@@ -6,11 +6,11 @@ LL | mod not_a_real_file;
    |
    = help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs"
 
-error[E0433]: failed to resolve: use of undeclared type or module `mod_file_aux`
+error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux`
   --> $DIR/mod_file_not_exist_windows.rs:7:16
    |
 LL |     assert_eq!(mod_file_aux::bar(), 10);
-   |                ^^^^^^^^^^^^ use of undeclared type or module `mod_file_aux`
+   |                ^^^^^^^^^^^^ use of undeclared crate or module `mod_file_aux`
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/pattern/pattern-error-continue.rs b/src/test/ui/pattern/pattern-error-continue.rs
index 8635622ab37..0702a9986fc 100644
--- a/src/test/ui/pattern/pattern-error-continue.rs
+++ b/src/test/ui/pattern/pattern-error-continue.rs
@@ -30,6 +30,6 @@ fn main() {
     //~| expected `char`, found `bool`
 
     match () {
-        E::V => {} //~ ERROR failed to resolve: use of undeclared type or module `E`
+        E::V => {} //~ ERROR failed to resolve: use of undeclared type `E`
     }
 }
diff --git a/src/test/ui/pattern/pattern-error-continue.stderr b/src/test/ui/pattern/pattern-error-continue.stderr
index 60f76796c03..497c93b2949 100644
--- a/src/test/ui/pattern/pattern-error-continue.stderr
+++ b/src/test/ui/pattern/pattern-error-continue.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared type or module `E`
+error[E0433]: failed to resolve: use of undeclared type `E`
   --> $DIR/pattern-error-continue.rs:33:9
    |
 LL |         E::V => {}
-   |         ^ use of undeclared type or module `E`
+   |         ^ use of undeclared type `E`
 
 error[E0532]: expected tuple struct or tuple variant, found unit variant `A::D`
   --> $DIR/pattern-error-continue.rs:18:9
diff --git a/src/test/ui/resolve/use_suggestion.stderr b/src/test/ui/resolve/use_suggestion.stderr
index 72dda940729..4fff179b1fe 100644
--- a/src/test/ui/resolve/use_suggestion.stderr
+++ b/src/test/ui/resolve/use_suggestion.stderr
@@ -1,10 +1,10 @@
-error[E0433]: failed to resolve: use of undeclared type or module `GooMap`
+error[E0433]: failed to resolve: use of undeclared type `GooMap`
   --> $DIR/use_suggestion.rs:3:14
    |
 LL |     let x2 = GooMap::new();
-   |              ^^^^^^ use of undeclared type or module `GooMap`
+   |              ^^^^^^ use of undeclared type `GooMap`
 
-error[E0433]: failed to resolve: use of undeclared type or module `HashMap`
+error[E0433]: failed to resolve: use of undeclared type `HashMap`
   --> $DIR/use_suggestion.rs:2:14
    |
 LL |     let x1 = HashMap::new();
diff --git a/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-1.stderr b/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-1.stderr
index 64b920e9aa7..81891572179 100644
--- a/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-1.stderr
+++ b/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-1.stderr
@@ -2,7 +2,7 @@ error[E0432]: unresolved import `xcrate`
   --> $DIR/non-existent-1.rs:3:5
    |
 LL | use xcrate::S;
-   |     ^^^^^^ use of undeclared type or module `xcrate`
+   |     ^^^^^^ use of undeclared crate or module `xcrate`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/suggestions/type-ascription-instead-of-path.rs b/src/test/ui/suggestions/type-ascription-instead-of-path.rs
index e92087e2947..ce40b55f1ee 100644
--- a/src/test/ui/suggestions/type-ascription-instead-of-path.rs
+++ b/src/test/ui/suggestions/type-ascription-instead-of-path.rs
@@ -1,5 +1,5 @@
 fn main() {
     std:io::stdin();
-    //~^ ERROR failed to resolve: use of undeclared type or module `io`
+    //~^ ERROR failed to resolve: use of undeclared crate or module `io`
     //~| ERROR expected value, found crate
 }
diff --git a/src/test/ui/suggestions/type-ascription-instead-of-path.stderr b/src/test/ui/suggestions/type-ascription-instead-of-path.stderr
index fd2fedc7640..518660cfa16 100644
--- a/src/test/ui/suggestions/type-ascription-instead-of-path.stderr
+++ b/src/test/ui/suggestions/type-ascription-instead-of-path.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared type or module `io`
+error[E0433]: failed to resolve: use of undeclared crate or module `io`
   --> $DIR/type-ascription-instead-of-path.rs:2:9
    |
 LL |     std:io::stdin();
-   |         ^^ use of undeclared type or module `io`
+   |         ^^ use of undeclared crate or module `io`
 
 error[E0423]: expected value, found crate `std`
   --> $DIR/type-ascription-instead-of-path.rs:2:5
diff --git a/src/test/ui/type-alias/issue-62263-self-in-atb.rs b/src/test/ui/type-alias/issue-62263-self-in-atb.rs
index 5e812db4d23..1f64b4cfe5c 100644
--- a/src/test/ui/type-alias/issue-62263-self-in-atb.rs
+++ b/src/test/ui/type-alias/issue-62263-self-in-atb.rs
@@ -3,6 +3,6 @@ pub trait Trait {
 }
 
 pub type Alias = dyn Trait<A = Self::A>;
-//~^ ERROR failed to resolve: use of undeclared type or module `Self` [E0433]
+//~^ ERROR failed to resolve: use of undeclared type `Self` [E0433]
 
 fn main() {}
diff --git a/src/test/ui/type-alias/issue-62263-self-in-atb.stderr b/src/test/ui/type-alias/issue-62263-self-in-atb.stderr
index a642d029f93..d34b6ed5038 100644
--- a/src/test/ui/type-alias/issue-62263-self-in-atb.stderr
+++ b/src/test/ui/type-alias/issue-62263-self-in-atb.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared type or module `Self`
+error[E0433]: failed to resolve: use of undeclared type `Self`
   --> $DIR/issue-62263-self-in-atb.rs:5:32
    |
 LL | pub type Alias = dyn Trait<A = Self::A>;
-   |                                ^^^^ use of undeclared type or module `Self`
+   |                                ^^^^ use of undeclared type `Self`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/type-alias/issue-62305-self-assoc-ty.rs b/src/test/ui/type-alias/issue-62305-self-assoc-ty.rs
index 0b95ddeb19e..999902fb18b 100644
--- a/src/test/ui/type-alias/issue-62305-self-assoc-ty.rs
+++ b/src/test/ui/type-alias/issue-62305-self-assoc-ty.rs
@@ -1,4 +1,4 @@
 type Alias = Self::Target;
-//~^ ERROR failed to resolve: use of undeclared type or module `Self` [E0433]
+//~^ ERROR failed to resolve: use of undeclared type `Self` [E0433]
 
 fn main() {}
diff --git a/src/test/ui/type-alias/issue-62305-self-assoc-ty.stderr b/src/test/ui/type-alias/issue-62305-self-assoc-ty.stderr
index 6eb445e9dbc..823a5fa50fc 100644
--- a/src/test/ui/type-alias/issue-62305-self-assoc-ty.stderr
+++ b/src/test/ui/type-alias/issue-62305-self-assoc-ty.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared type or module `Self`
+error[E0433]: failed to resolve: use of undeclared type `Self`
   --> $DIR/issue-62305-self-assoc-ty.rs:1:14
    |
 LL | type Alias = Self::Target;
-   |              ^^^^ use of undeclared type or module `Self`
+   |              ^^^^ use of undeclared type `Self`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/type/type-path-err-node-types.rs b/src/test/ui/type/type-path-err-node-types.rs
index 15adfebb334..b3795772e6f 100644
--- a/src/test/ui/type/type-path-err-node-types.rs
+++ b/src/test/ui/type/type-path-err-node-types.rs
@@ -12,7 +12,7 @@ fn ufcs_trait() {
 }
 
 fn ufcs_item() {
-    NonExistent::Assoc::<u8>; //~ ERROR undeclared type or module `NonExistent`
+    NonExistent::Assoc::<u8>; //~ ERROR undeclared type `NonExistent`
 }
 
 fn method() {
diff --git a/src/test/ui/type/type-path-err-node-types.stderr b/src/test/ui/type/type-path-err-node-types.stderr
index ea9cca2bfaa..baf218243c4 100644
--- a/src/test/ui/type/type-path-err-node-types.stderr
+++ b/src/test/ui/type/type-path-err-node-types.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared type or module `NonExistent`
+error[E0433]: failed to resolve: use of undeclared type `NonExistent`
   --> $DIR/type-path-err-node-types.rs:15:5
    |
 LL |     NonExistent::Assoc::<u8>;
-   |     ^^^^^^^^^^^ use of undeclared type or module `NonExistent`
+   |     ^^^^^^^^^^^ use of undeclared type `NonExistent`
 
 error[E0412]: cannot find type `Nonexistent` in this scope
   --> $DIR/type-path-err-node-types.rs:7:12
diff --git a/src/test/ui/unknown-tool-name.rs b/src/test/ui/unknown-tool-name.rs
index 05f99ced687..73fca61c65d 100644
--- a/src/test/ui/unknown-tool-name.rs
+++ b/src/test/ui/unknown-tool-name.rs
@@ -1,2 +1,2 @@
-#[foo::bar] //~ ERROR failed to resolve: use of undeclared type or module `foo`
+#[foo::bar] //~ ERROR failed to resolve: use of undeclared crate or module `foo`
 fn main() {}
diff --git a/src/test/ui/unknown-tool-name.stderr b/src/test/ui/unknown-tool-name.stderr
index 7a6ed57bda6..4a1370ba80a 100644
--- a/src/test/ui/unknown-tool-name.stderr
+++ b/src/test/ui/unknown-tool-name.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared type or module `foo`
+error[E0433]: failed to resolve: use of undeclared crate or module `foo`
   --> $DIR/unknown-tool-name.rs:1:3
    |
 LL | #[foo::bar]
-   |   ^^^ use of undeclared type or module `foo`
+   |   ^^^ use of undeclared crate or module `foo`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/use/use-self-type.rs b/src/test/ui/use/use-self-type.rs
index 3e5c7bf3cca..370593b2eb2 100644
--- a/src/test/ui/use/use-self-type.rs
+++ b/src/test/ui/use/use-self-type.rs
@@ -4,7 +4,7 @@ impl S {
     fn f() {}
     fn g() {
         use Self::f; //~ ERROR unresolved import
-        pub(in Self::f) struct Z; //~ ERROR use of undeclared type or module `Self`
+        pub(in Self::f) struct Z; //~ ERROR use of undeclared type `Self`
     }
 }
 
diff --git a/src/test/ui/use/use-self-type.stderr b/src/test/ui/use/use-self-type.stderr
index 0dd0e04267c..d1469fb3490 100644
--- a/src/test/ui/use/use-self-type.stderr
+++ b/src/test/ui/use/use-self-type.stderr
@@ -1,14 +1,14 @@
-error[E0433]: failed to resolve: use of undeclared type or module `Self`
+error[E0433]: failed to resolve: use of undeclared type `Self`
   --> $DIR/use-self-type.rs:7:16
    |
 LL |         pub(in Self::f) struct Z;
-   |                ^^^^ use of undeclared type or module `Self`
+   |                ^^^^ use of undeclared type `Self`
 
 error[E0432]: unresolved import `Self`
   --> $DIR/use-self-type.rs:6:13
    |
 LL |         use Self::f;
-   |             ^^^^ use of undeclared type or module `Self`
+   |             ^^^^ use of undeclared type `Self`
 
 error: aborting due to 2 previous errors