about summary refs log tree commit diff
path: root/src/test/ui/span
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2020-11-14 14:47:14 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2021-02-07 20:08:45 +0300
commitdbdbd30bf2cb0d48c8bbce83c2458592664dbb18 (patch)
tree92877e16f45e3cf927ffc4296e0f90c48ec036f5 /src/test/ui/span
parentae00b62ceb7eaf1f02f5289ab233bf7e0e8060d5 (diff)
downloadrust-dbdbd30bf2cb0d48c8bbce83c2458592664dbb18.tar.gz
rust-dbdbd30bf2cb0d48c8bbce83c2458592664dbb18.zip
expand/resolve: Turn `#[derive]` into a regular macro attribute
Diffstat (limited to 'src/test/ui/span')
-rw-r--r--src/test/ui/span/issue-43927-non-ADT-derive.rs7
-rw-r--r--src/test/ui/span/issue-43927-non-ADT-derive.stderr31
-rw-r--r--src/test/ui/span/macro-ty-params.rs2
-rw-r--r--src/test/ui/span/macro-ty-params.stderr2
4 files changed, 7 insertions, 35 deletions
diff --git a/src/test/ui/span/issue-43927-non-ADT-derive.rs b/src/test/ui/span/issue-43927-non-ADT-derive.rs
index 8f1599a5abc..840c12e16e1 100644
--- a/src/test/ui/span/issue-43927-non-ADT-derive.rs
+++ b/src/test/ui/span/issue-43927-non-ADT-derive.rs
@@ -1,10 +1,5 @@
-#![allow(dead_code)]
-
 #![derive(Debug, PartialEq, Eq)] // should be an outer attribute!
-//~^ ERROR `derive` may only be applied to structs, enums and unions
-//~| ERROR cannot determine resolution for the derive macro `Debug`
-//~| ERROR cannot determine resolution for the derive macro `PartialEq`
-//~| ERROR cannot determine resolution for the derive macro `Eq`
+//~^ ERROR cannot determine resolution for the attribute macro `derive`
 struct DerivedOn;
 
 fn main() {}
diff --git a/src/test/ui/span/issue-43927-non-ADT-derive.stderr b/src/test/ui/span/issue-43927-non-ADT-derive.stderr
index 85beac535c9..9ef81c5150a 100644
--- a/src/test/ui/span/issue-43927-non-ADT-derive.stderr
+++ b/src/test/ui/span/issue-43927-non-ADT-derive.stderr
@@ -1,33 +1,10 @@
-error[E0774]: `derive` may only be applied to structs, enums and unions
-  --> $DIR/issue-43927-non-ADT-derive.rs:3:1
+error: cannot determine resolution for the attribute macro `derive`
+  --> $DIR/issue-43927-non-ADT-derive.rs:1:4
    |
 LL | #![derive(Debug, PartialEq, Eq)] // should be an outer attribute!
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try an outer attribute: `#[derive(Debug, PartialEq, Eq)]`
-
-error: cannot determine resolution for the derive macro `Debug`
-  --> $DIR/issue-43927-non-ADT-derive.rs:3:11
-   |
-LL | #![derive(Debug, PartialEq, Eq)] // should be an outer attribute!
-   |           ^^^^^
-   |
-   = note: import resolution is stuck, try simplifying macro imports
-
-error: cannot determine resolution for the derive macro `PartialEq`
-  --> $DIR/issue-43927-non-ADT-derive.rs:3:18
-   |
-LL | #![derive(Debug, PartialEq, Eq)] // should be an outer attribute!
-   |                  ^^^^^^^^^
-   |
-   = note: import resolution is stuck, try simplifying macro imports
-
-error: cannot determine resolution for the derive macro `Eq`
-  --> $DIR/issue-43927-non-ADT-derive.rs:3:29
-   |
-LL | #![derive(Debug, PartialEq, Eq)] // should be an outer attribute!
-   |                             ^^
+   |    ^^^^^^
    |
    = note: import resolution is stuck, try simplifying macro imports
 
-error: aborting due to 4 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0774`.
diff --git a/src/test/ui/span/macro-ty-params.rs b/src/test/ui/span/macro-ty-params.rs
index 713b9eb542c..0a93105b664 100644
--- a/src/test/ui/span/macro-ty-params.rs
+++ b/src/test/ui/span/macro-ty-params.rs
@@ -9,5 +9,5 @@ macro_rules! foo { () => () }
 fn main() {
     foo::<T>!(); //~ ERROR generic arguments in macro path
     foo::<>!(); //~ ERROR generic arguments in macro path
-    m!(Default<>); //~ ERROR generic arguments in macro path
+    m!(Default<>); //~ ERROR unexpected generic arguments in path
 }
diff --git a/src/test/ui/span/macro-ty-params.stderr b/src/test/ui/span/macro-ty-params.stderr
index 21683b2fb86..138cd2598a1 100644
--- a/src/test/ui/span/macro-ty-params.stderr
+++ b/src/test/ui/span/macro-ty-params.stderr
@@ -10,7 +10,7 @@ error: generic arguments in macro path
 LL |     foo::<>!();
    |          ^^
 
-error: generic arguments in macro path
+error: unexpected generic arguments in path
   --> $DIR/macro-ty-params.rs:12:15
    |
 LL |     m!(Default<>);