about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2021-03-07 14:19:50 -0800
committerManish Goregaokar <manishsmail@gmail.com>2021-03-07 14:24:47 -0800
commit9d5d669b77f8c100f3e01a7bd5924d30c8bad152 (patch)
tree5ee539fa8a3d94fa3159d285ca4f4d17515ee718 /src/test/ui
parentac7f9ccb6f84922d316a3efa2f50061d4af22801 (diff)
downloadrust-9d5d669b77f8c100f3e01a7bd5924d30c8bad152.tar.gz
rust-9d5d669b77f8c100f3e01a7bd5924d30c8bad152.zip
diagnostics: Differentiate between edition meanings of ::foo in resolve diagnostics for ::foo::Bar
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/editions-crate-root-2015.rs7
-rw-r--r--src/test/ui/editions-crate-root-2015.stderr19
-rw-r--r--src/test/ui/editions-crate-root-2018.rs7
-rw-r--r--src/test/ui/editions-crate-root-2018.stderr17
-rw-r--r--src/test/ui/resolve/raw-ident-in-path.rs2
-rw-r--r--src/test/ui/resolve/raw-ident-in-path.stderr4
6 files changed, 48 insertions, 8 deletions
diff --git a/src/test/ui/editions-crate-root-2015.rs b/src/test/ui/editions-crate-root-2015.rs
index 71b7112804d..fc35b001a60 100644
--- a/src/test/ui/editions-crate-root-2015.rs
+++ b/src/test/ui/editions-crate-root-2015.rs
@@ -7,6 +7,13 @@ mod inner {
     fn crate_inner(_: crate::nonexistant::Foo) {
         //~^ ERROR failed to resolve: maybe a missing crate `nonexistant`?
     }
+
+    fn bare_global(_: ::nonexistant) {
+        //~^ ERROR cannot find type `nonexistant` in the crate root
+    }
+    fn bare_crate(_: crate::nonexistant) {
+        //~^ ERROR cannot find type `nonexistant` in the crate root
+    }
 }
 
 fn main() {
diff --git a/src/test/ui/editions-crate-root-2015.stderr b/src/test/ui/editions-crate-root-2015.stderr
index 94c972227d0..f8d65fec3d1 100644
--- a/src/test/ui/editions-crate-root-2015.stderr
+++ b/src/test/ui/editions-crate-root-2015.stderr
@@ -5,11 +5,24 @@ LL |     fn global_inner(_: ::nonexistant::Foo) {
    |                          ^^^^^^^^^^^ maybe a missing crate `nonexistant`?
 
 error[E0433]: failed to resolve: maybe a missing crate `nonexistant`?
-  --> $DIR/editions-crate-root-2015.rs:8:30
+  --> $DIR/editions-crate-root-2015.rs:7:30
    |
 LL |     fn crate_inner(_: crate::nonexistant::Foo) {
    |                              ^^^^^^^^^^^ maybe a missing crate `nonexistant`?
 
-error: aborting due to 2 previous errors
+error[E0412]: cannot find type `nonexistant` in the crate root
+  --> $DIR/editions-crate-root-2015.rs:11:25
+   |
+LL |     fn bare_global(_: ::nonexistant) {
+   |                         ^^^^^^^^^^^ not found in the crate root
+
+error[E0412]: cannot find type `nonexistant` in the crate root
+  --> $DIR/editions-crate-root-2015.rs:14:29
+   |
+LL |     fn bare_crate(_: crate::nonexistant) {
+   |                             ^^^^^^^^^^^ not found in the crate root
+
+error: aborting due to 4 previous errors
 
-For more information about this error, try `rustc --explain E0433`.
+Some errors have detailed explanations: E0412, E0433.
+For more information about an error, try `rustc --explain E0412`.
diff --git a/src/test/ui/editions-crate-root-2018.rs b/src/test/ui/editions-crate-root-2018.rs
index 7e65f00920e..7b96c1d294b 100644
--- a/src/test/ui/editions-crate-root-2018.rs
+++ b/src/test/ui/editions-crate-root-2018.rs
@@ -7,6 +7,13 @@ mod inner {
     fn crate_inner(_: crate::nonexistant::Foo) {
         //~^ ERROR failed to resolve: maybe a missing crate `nonexistant`?
     }
+
+    fn bare_global(_: ::nonexistant) {
+        //~^ ERROR cannot find crate `nonexistant` in the list of imported crates
+    }
+    fn bare_crate(_: crate::nonexistant) {
+        //~^ ERROR cannot find type `nonexistant` in the crate root
+    }
 }
 
 fn main() {
diff --git a/src/test/ui/editions-crate-root-2018.stderr b/src/test/ui/editions-crate-root-2018.stderr
index 95a36907448..7dfd3442260 100644
--- a/src/test/ui/editions-crate-root-2018.stderr
+++ b/src/test/ui/editions-crate-root-2018.stderr
@@ -10,6 +10,19 @@ error[E0433]: failed to resolve: maybe a missing crate `nonexistant`?
 LL |     fn crate_inner(_: crate::nonexistant::Foo) {
    |                              ^^^^^^^^^^^ maybe a missing crate `nonexistant`?
 
-error: aborting due to 2 previous errors
+error[E0412]: cannot find crate `nonexistant` in the list of imported crates
+  --> $DIR/editions-crate-root-2018.rs:11:25
+   |
+LL |     fn bare_global(_: ::nonexistant) {
+   |                         ^^^^^^^^^^^ not found in the list of imported crates
+
+error[E0412]: cannot find type `nonexistant` in the crate root
+  --> $DIR/editions-crate-root-2018.rs:14:29
+   |
+LL |     fn bare_crate(_: crate::nonexistant) {
+   |                             ^^^^^^^^^^^ not found in the crate root
+
+error: aborting due to 4 previous errors
 
-For more information about this error, try `rustc --explain E0433`.
+Some errors have detailed explanations: E0412, E0433.
+For more information about an error, try `rustc --explain E0412`.
diff --git a/src/test/ui/resolve/raw-ident-in-path.rs b/src/test/ui/resolve/raw-ident-in-path.rs
index 1bcbef59437..7f1163bebde 100644
--- a/src/test/ui/resolve/raw-ident-in-path.rs
+++ b/src/test/ui/resolve/raw-ident-in-path.rs
@@ -1,5 +1,5 @@
 // Regression test for issue #63882.
 
-type A = crate::r#break; //~ ERROR cannot find type `r#break` in module `crate`
+type A = crate::r#break; //~ ERROR cannot find type `r#break` in the crate root
 
 fn main() {}
diff --git a/src/test/ui/resolve/raw-ident-in-path.stderr b/src/test/ui/resolve/raw-ident-in-path.stderr
index f2efcbc8e85..771dacbbb20 100644
--- a/src/test/ui/resolve/raw-ident-in-path.stderr
+++ b/src/test/ui/resolve/raw-ident-in-path.stderr
@@ -1,8 +1,8 @@
-error[E0412]: cannot find type `r#break` in module `crate`
+error[E0412]: cannot find type `r#break` in the crate root
   --> $DIR/raw-ident-in-path.rs:3:17
    |
 LL | type A = crate::r#break;
-   |                 ^^^^^^^ not found in `crate`
+   |                 ^^^^^^^ not found in the crate root
 
 error: aborting due to previous error