about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2021-08-22 17:16:24 +0200
committerMara Bos <m-ou.se@m-ou.se>2021-08-23 16:57:58 +0200
commit5dea5d7549acbd85f7c2a7b63c8d8aeeb5f6de07 (patch)
tree9985c8f8ddb82d57a4021c1c5bd29e989205aa5e /src
parentd834d2a7422886890c861e120af5f6a9e9ca9985 (diff)
downloadrust-5dea5d7549acbd85f7c2a7b63c8d8aeeb5f6de07.tar.gz
rust-5dea5d7549acbd85f7c2a7b63c8d8aeeb5f6de07.zip
Say what things are, instead of what they are not.
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/macros/issue-88206.rs20
-rw-r--r--src/test/ui/macros/issue-88206.stderr54
-rw-r--r--src/test/ui/tool-attributes/tool-attributes-misplaced-1.stderr8
3 files changed, 50 insertions, 32 deletions
diff --git a/src/test/ui/macros/issue-88206.rs b/src/test/ui/macros/issue-88206.rs
index f0dab54c149..9f1306349e9 100644
--- a/src/test/ui/macros/issue-88206.rs
+++ b/src/test/ui/macros/issue-88206.rs
@@ -3,18 +3,21 @@
 #![warn(unused_imports)]
 
 use std::str::*;
-//~^ NOTE `from_utf8` is imported here, but it is not a macro
-//~| NOTE `from_utf8_mut` is imported here, but it is not a derive macro
-//~| NOTE `from_utf8_unchecked` is imported here, but it is not an attribute
+//~^ NOTE `from_utf8` is imported here, but it is a function
+//~| NOTE `from_utf8_mut` is imported here, but it is a function
+//~| NOTE `from_utf8_unchecked` is imported here, but it is a function
 
 mod hey {
     pub trait Serialize {}
     pub trait Deserialize {}
+
+    pub struct X(i32);
 }
 
-use hey::{Serialize, Deserialize};
-//~^ NOTE `Serialize` is imported here, but it is not a derive macro
-//~| NOTE `Deserialize` is imported here, but it is not an attribute
+use hey::{Serialize, Deserialize, X};
+//~^ NOTE `Serialize` is imported here, but it is a trait
+//~| NOTE `Deserialize` is imported here, but it is a trait
+//~| NOTE `X` is imported here, but it is a struct
 
 #[derive(Serialize)]
 //~^ ERROR cannot find derive macro `Serialize`
@@ -48,7 +51,7 @@ fn main() {
 
     Box!();
     //~^ ERROR cannot find macro `Box`
-    //~| NOTE `Box` is in scope, but it is not a macro
+    //~| NOTE `Box` is in scope, but it is a struct
 
     Copy!();
     //~^ ERROR cannot find macro `Copy`
@@ -57,4 +60,7 @@ fn main() {
     test!();
     //~^ ERROR cannot find macro `test`
     //~| NOTE `test` is in scope, but it is an attribute
+
+    X!();
+    //~^ ERROR cannot find macro `X`
 }
diff --git a/src/test/ui/macros/issue-88206.stderr b/src/test/ui/macros/issue-88206.stderr
index b6fd606e28c..9220c16f6ae 100644
--- a/src/test/ui/macros/issue-88206.stderr
+++ b/src/test/ui/macros/issue-88206.stderr
@@ -1,5 +1,17 @@
+error: cannot find macro `X` in this scope
+  --> $DIR/issue-88206.rs:64:5
+   |
+LL |     X!();
+   |     ^
+   |
+note: `X` is imported here, but it is a struct
+  --> $DIR/issue-88206.rs:17:35
+   |
+LL | use hey::{Serialize, Deserialize, X};
+   |                                   ^
+
 error: cannot find macro `test` in this scope
-  --> $DIR/issue-88206.rs:57:5
+  --> $DIR/issue-88206.rs:60:5
    |
 LL |     test!();
    |     ^^^^
@@ -7,7 +19,7 @@ LL |     test!();
    = note: `test` is in scope, but it is an attribute
 
 error: cannot find macro `Copy` in this scope
-  --> $DIR/issue-88206.rs:53:5
+  --> $DIR/issue-88206.rs:56:5
    |
 LL |     Copy!();
    |     ^^^^
@@ -15,27 +27,27 @@ LL |     Copy!();
    = note: `Copy` is in scope, but it is a derive macro
 
 error: cannot find macro `Box` in this scope
-  --> $DIR/issue-88206.rs:49:5
+  --> $DIR/issue-88206.rs:52:5
    |
 LL |     Box!();
    |     ^^^
    |
-   = note: `Box` is in scope, but it is not a macro
+   = note: `Box` is in scope, but it is a struct
 
 error: cannot find macro `from_utf8` in this scope
-  --> $DIR/issue-88206.rs:46:5
+  --> $DIR/issue-88206.rs:49:5
    |
 LL |     from_utf8!();
    |     ^^^^^^^^^
    |
-note: `from_utf8` is imported here, but it is not a macro
+note: `from_utf8` is imported here, but it is a function
   --> $DIR/issue-88206.rs:5:5
    |
 LL | use std::str::*;
    |     ^^^^^^^^^^^
 
 error: cannot find attribute `println` in this scope
-  --> $DIR/issue-88206.rs:40:3
+  --> $DIR/issue-88206.rs:43:3
    |
 LL | #[println]
    |   ^^^^^^^
@@ -43,31 +55,31 @@ LL | #[println]
    = note: `println` is in scope, but it is a function-like macro
 
 error: cannot find attribute `from_utf8_unchecked` in this scope
-  --> $DIR/issue-88206.rs:36:3
+  --> $DIR/issue-88206.rs:39:3
    |
 LL | #[from_utf8_unchecked]
    |   ^^^^^^^^^^^^^^^^^^^
    |
-note: `from_utf8_unchecked` is imported here, but it is not an attribute
+note: `from_utf8_unchecked` is imported here, but it is a function
   --> $DIR/issue-88206.rs:5:5
    |
 LL | use std::str::*;
    |     ^^^^^^^^^^^
 
 error: cannot find attribute `Deserialize` in this scope
-  --> $DIR/issue-88206.rs:32:3
+  --> $DIR/issue-88206.rs:35:3
    |
 LL | #[Deserialize]
    |   ^^^^^^^^^^^
    |
-note: `Deserialize` is imported here, but it is not an attribute
-  --> $DIR/issue-88206.rs:15:22
+note: `Deserialize` is imported here, but it is a trait
+  --> $DIR/issue-88206.rs:17:22
    |
-LL | use hey::{Serialize, Deserialize};
+LL | use hey::{Serialize, Deserialize, X};
    |                      ^^^^^^^^^^^
 
 error: cannot find derive macro `println` in this scope
-  --> $DIR/issue-88206.rs:27:10
+  --> $DIR/issue-88206.rs:30:10
    |
 LL | #[derive(println)]
    |          ^^^^^^^
@@ -75,28 +87,28 @@ LL | #[derive(println)]
    = note: `println` is in scope, but it is a function-like macro
 
 error: cannot find derive macro `from_utf8_mut` in this scope
-  --> $DIR/issue-88206.rs:23:10
+  --> $DIR/issue-88206.rs:26:10
    |
 LL | #[derive(from_utf8_mut)]
    |          ^^^^^^^^^^^^^
    |
-note: `from_utf8_mut` is imported here, but it is not a derive macro
+note: `from_utf8_mut` is imported here, but it is a function
   --> $DIR/issue-88206.rs:5:5
    |
 LL | use std::str::*;
    |     ^^^^^^^^^^^
 
 error: cannot find derive macro `Serialize` in this scope
-  --> $DIR/issue-88206.rs:19:10
+  --> $DIR/issue-88206.rs:22:10
    |
 LL | #[derive(Serialize)]
    |          ^^^^^^^^^
    |
-note: `Serialize` is imported here, but it is not a derive macro
-  --> $DIR/issue-88206.rs:15:11
+note: `Serialize` is imported here, but it is a trait
+  --> $DIR/issue-88206.rs:17:11
    |
-LL | use hey::{Serialize, Deserialize};
+LL | use hey::{Serialize, Deserialize, X};
    |           ^^^^^^^^^
 
-error: aborting due to 10 previous errors
+error: aborting due to 11 previous errors
 
diff --git a/src/test/ui/tool-attributes/tool-attributes-misplaced-1.stderr b/src/test/ui/tool-attributes/tool-attributes-misplaced-1.stderr
index 2d20d103465..6e875eebb46 100644
--- a/src/test/ui/tool-attributes/tool-attributes-misplaced-1.stderr
+++ b/src/test/ui/tool-attributes/tool-attributes-misplaced-1.stderr
@@ -4,7 +4,7 @@ error: cannot find derive macro `rustfmt` in this scope
 LL | #[derive(rustfmt)]
    |          ^^^^^^^
    |
-   = note: `rustfmt` is in scope, but it is not a derive macro
+   = note: `rustfmt` is in scope, but it is a tool module
 
 error: cannot find derive macro `rustfmt` in this scope
   --> $DIR/tool-attributes-misplaced-1.rs:4:10
@@ -12,7 +12,7 @@ error: cannot find derive macro `rustfmt` in this scope
 LL | #[derive(rustfmt)]
    |          ^^^^^^^
    |
-   = note: `rustfmt` is in scope, but it is not a derive macro
+   = note: `rustfmt` is in scope, but it is a tool module
 
 error: cannot find attribute `rustfmt` in this scope
   --> $DIR/tool-attributes-misplaced-1.rs:9:3
@@ -20,7 +20,7 @@ error: cannot find attribute `rustfmt` in this scope
 LL | #[rustfmt]
    |   ^^^^^^^
    |
-   = note: `rustfmt` is in scope, but it is not an attribute
+   = note: `rustfmt` is in scope, but it is a tool module
 
 error: cannot find macro `rustfmt` in this scope
   --> $DIR/tool-attributes-misplaced-1.rs:15:5
@@ -28,7 +28,7 @@ error: cannot find macro `rustfmt` in this scope
 LL |     rustfmt!();
    |     ^^^^^^^
    |
-   = note: `rustfmt` is in scope, but it is not a macro
+   = note: `rustfmt` is in scope, but it is a tool module
 
 error[E0573]: expected type, found tool module `rustfmt`
   --> $DIR/tool-attributes-misplaced-1.rs:1:10