about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/macros/defined-later-issue-121061-2.stderr2
-rw-r--r--tests/ui/macros/defined-later-issue-121061.stderr2
-rw-r--r--tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.rs9
-rw-r--r--tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.stderr42
4 files changed, 53 insertions, 2 deletions
diff --git a/tests/ui/macros/defined-later-issue-121061-2.stderr b/tests/ui/macros/defined-later-issue-121061-2.stderr
index aa6ef338531..2ec590d46ed 100644
--- a/tests/ui/macros/defined-later-issue-121061-2.stderr
+++ b/tests/ui/macros/defined-later-issue-121061-2.stderr
@@ -4,7 +4,7 @@ error: cannot find macro `something_later` in this scope
 LL |         something_later!();
    |         ^^^^^^^^^^^^^^^ consider moving the definition of `something_later` before this call
    |
-note: a macro with the same name exists, but it appears later at here
+note: a macro with the same name exists, but it appears later
   --> $DIR/defined-later-issue-121061-2.rs:6:18
    |
 LL |     macro_rules! something_later {
diff --git a/tests/ui/macros/defined-later-issue-121061.stderr b/tests/ui/macros/defined-later-issue-121061.stderr
index 65cb53432a9..7b3496991af 100644
--- a/tests/ui/macros/defined-later-issue-121061.stderr
+++ b/tests/ui/macros/defined-later-issue-121061.stderr
@@ -4,7 +4,7 @@ error: cannot find macro `something_later` in this scope
 LL |     something_later!();
    |     ^^^^^^^^^^^^^^^ consider moving the definition of `something_later` before this call
    |
-note: a macro with the same name exists, but it appears later at here
+note: a macro with the same name exists, but it appears later
   --> $DIR/defined-later-issue-121061.rs:5:14
    |
 LL | macro_rules! something_later {
diff --git a/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.rs b/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.rs
new file mode 100644
index 00000000000..a2e1398c61e
--- /dev/null
+++ b/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.rs
@@ -0,0 +1,9 @@
+#![crate_type = "lib"]
+
+macro_rules! sample { () => {} }
+
+#[sample]           //~ ERROR cannot find attribute `sample` in this scope
+#[derive(sample)]   //~ ERROR cannot find derive macro `sample` in this scope
+                    //~| ERROR cannot find derive macro `sample` in this scope
+                    //~| ERROR cannot find derive macro `sample` in this scope
+pub struct S {}
diff --git a/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.stderr b/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.stderr
new file mode 100644
index 00000000000..e5b913b208d
--- /dev/null
+++ b/tests/ui/macros/macro-rules-as-derive-or-attr-issue-132928.stderr
@@ -0,0 +1,42 @@
+error: cannot find derive macro `sample` in this scope
+  --> $DIR/macro-rules-as-derive-or-attr-issue-132928.rs:6:10
+   |
+LL | macro_rules! sample { () => {} }
+   |              ------ `sample` exists, but a declarative macro cannot be used as a derive macro
+...
+LL | #[derive(sample)]
+   |          ^^^^^^
+
+error: cannot find attribute `sample` in this scope
+  --> $DIR/macro-rules-as-derive-or-attr-issue-132928.rs:5:3
+   |
+LL | macro_rules! sample { () => {} }
+   |              ------ `sample` exists, but a declarative macro cannot be used as an attribute macro
+LL |
+LL | #[sample]
+   |   ^^^^^^
+
+error: cannot find derive macro `sample` in this scope
+  --> $DIR/macro-rules-as-derive-or-attr-issue-132928.rs:6:10
+   |
+LL | macro_rules! sample { () => {} }
+   |              ------ `sample` exists, but a declarative macro cannot be used as a derive macro
+...
+LL | #[derive(sample)]
+   |          ^^^^^^
+   |
+   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+
+error: cannot find derive macro `sample` in this scope
+  --> $DIR/macro-rules-as-derive-or-attr-issue-132928.rs:6:10
+   |
+LL | macro_rules! sample { () => {} }
+   |              ------ `sample` exists, but a declarative macro cannot be used as a derive macro
+...
+LL | #[derive(sample)]
+   |          ^^^^^^
+   |
+   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+
+error: aborting due to 4 previous errors
+