diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 11b0ade1e83e..2ce54658c0b1 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -2433,8 +2433,10 @@ impl<'a> Resolver<'a> { Applicability::MaybeIncorrect, )), ) - } else { + } else if self.session.edition() == Edition::Edition2015 { (format!("maybe a missing crate `{}`?", ident), None) + } else { + (format!("could not find `{}` in the crate root", ident), None) } } else if i == 0 { if ident diff --git a/src/test/ui/editions-crate-root-2015.rs b/src/test/ui/editions-crate-root-2015.rs index fc35b001a60d..4c890e3ae699 100644 --- a/src/test/ui/editions-crate-root-2015.rs +++ b/src/test/ui/editions-crate-root-2015.rs @@ -18,4 +18,4 @@ mod inner { fn main() { -} \ No newline at end of file +} diff --git a/src/test/ui/editions-crate-root-2018.rs b/src/test/ui/editions-crate-root-2018.rs index 7b96c1d294b8..61e4329bbb34 100644 --- a/src/test/ui/editions-crate-root-2018.rs +++ b/src/test/ui/editions-crate-root-2018.rs @@ -5,7 +5,7 @@ mod inner { //~^ ERROR failed to resolve: could not find `nonexistant` in the list of imported crates } fn crate_inner(_: crate::nonexistant::Foo) { - //~^ ERROR failed to resolve: maybe a missing crate `nonexistant`? + //~^ ERROR failed to resolve: could not find `nonexistant` in the crate root } fn bare_global(_: ::nonexistant) { @@ -18,4 +18,4 @@ mod inner { fn main() { -} \ No newline at end of file +} diff --git a/src/test/ui/editions-crate-root-2018.stderr b/src/test/ui/editions-crate-root-2018.stderr index 7dfd34422604..967a5a2fca15 100644 --- a/src/test/ui/editions-crate-root-2018.stderr +++ b/src/test/ui/editions-crate-root-2018.stderr @@ -4,11 +4,11 @@ error[E0433]: failed to resolve: could not find `nonexistant` in the list of imp LL | fn global_inner(_: ::nonexistant::Foo) { | ^^^^^^^^^^^ could not find `nonexistant` in the list of imported crates -error[E0433]: failed to resolve: maybe a missing crate `nonexistant`? +error[E0433]: failed to resolve: could not find `nonexistant` in the crate root --> $DIR/editions-crate-root-2018.rs:7:30 | LL | fn crate_inner(_: crate::nonexistant::Foo) { - | ^^^^^^^^^^^ maybe a missing crate `nonexistant`? + | ^^^^^^^^^^^ could not find `nonexistant` in the crate root error[E0412]: cannot find crate `nonexistant` in the list of imported crates --> $DIR/editions-crate-root-2018.rs:11:25