about summary refs log tree commit diff
path: root/src/test/ui/malformed
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/malformed
parentae00b62ceb7eaf1f02f5289ab233bf7e0e8060d5 (diff)
downloadrust-dbdbd30bf2cb0d48c8bbce83c2458592664dbb18.tar.gz
rust-dbdbd30bf2cb0d48c8bbce83c2458592664dbb18.zip
expand/resolve: Turn `#[derive]` into a regular macro attribute
Diffstat (limited to 'src/test/ui/malformed')
-rw-r--r--src/test/ui/malformed/issue-69341-malformed-derive-inert.rs5
-rw-r--r--src/test/ui/malformed/issue-69341-malformed-derive-inert.stderr21
-rw-r--r--src/test/ui/malformed/malformed-derive-entry.stderr2
-rw-r--r--src/test/ui/malformed/malformed-special-attrs.stderr4
4 files changed, 8 insertions, 24 deletions
diff --git a/src/test/ui/malformed/issue-69341-malformed-derive-inert.rs b/src/test/ui/malformed/issue-69341-malformed-derive-inert.rs
index 1fd7cddc7c9..fc4c3f4e64b 100644
--- a/src/test/ui/malformed/issue-69341-malformed-derive-inert.rs
+++ b/src/test/ui/malformed/issue-69341-malformed-derive-inert.rs
@@ -1,9 +1,6 @@
 fn main() {}
 
 struct CLI {
-    #[derive(parse())]
-    //~^ ERROR traits in `#[derive(...)]` don't accept arguments
-    //~| ERROR cannot find derive macro `parse` in this scope
+    #[derive(parse())] //~ ERROR expected non-macro attribute, found attribute macro
     path: (),
-    //~^ ERROR `derive` may only be applied to structs, enums and unions
 }
diff --git a/src/test/ui/malformed/issue-69341-malformed-derive-inert.stderr b/src/test/ui/malformed/issue-69341-malformed-derive-inert.stderr
index db40ce07530..04f7ebe019e 100644
--- a/src/test/ui/malformed/issue-69341-malformed-derive-inert.stderr
+++ b/src/test/ui/malformed/issue-69341-malformed-derive-inert.stderr
@@ -1,21 +1,8 @@
-error: traits in `#[derive(...)]` don't accept arguments
-  --> $DIR/issue-69341-malformed-derive-inert.rs:4:19
+error: expected non-macro attribute, found attribute macro `derive`
+  --> $DIR/issue-69341-malformed-derive-inert.rs:4:7
    |
 LL |     #[derive(parse())]
-   |                   ^^ help: remove the arguments
+   |       ^^^^^^ not a non-macro attribute
 
-error[E0774]: `derive` may only be applied to structs, enums and unions
-  --> $DIR/issue-69341-malformed-derive-inert.rs:7:5
-   |
-LL |     path: (),
-   |     ^^^^^^^^
-
-error: cannot find derive macro `parse` in this scope
-  --> $DIR/issue-69341-malformed-derive-inert.rs:4:14
-   |
-LL |     #[derive(parse())]
-   |              ^^^^^
-
-error: aborting due to 3 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0774`.
diff --git a/src/test/ui/malformed/malformed-derive-entry.stderr b/src/test/ui/malformed/malformed-derive-entry.stderr
index 63be8f9ca14..365cc099e9d 100644
--- a/src/test/ui/malformed/malformed-derive-entry.stderr
+++ b/src/test/ui/malformed/malformed-derive-entry.stderr
@@ -14,7 +14,7 @@ error: malformed `derive` attribute input
   --> $DIR/malformed-derive-entry.rs:11:1
    |
 LL | #[derive]
-   | ^^^^^^^^^ help: missing traits to be derived: `#[derive(Trait1, Trait2, ...)]`
+   | ^^^^^^^^^ help: must be of the form: `#[derive(Trait1, Trait2, ...)]`
 
 error[E0277]: the trait bound `Test1: Clone` is not satisfied
   --> $DIR/malformed-derive-entry.rs:1:10
diff --git a/src/test/ui/malformed/malformed-special-attrs.stderr b/src/test/ui/malformed/malformed-special-attrs.stderr
index 6f535e03e6a..1764c3969cf 100644
--- a/src/test/ui/malformed/malformed-special-attrs.stderr
+++ b/src/test/ui/malformed/malformed-special-attrs.stderr
@@ -18,13 +18,13 @@ error: malformed `derive` attribute input
   --> $DIR/malformed-special-attrs.rs:7:1
    |
 LL | #[derive]
-   | ^^^^^^^^^ help: missing traits to be derived: `#[derive(Trait1, Trait2, ...)]`
+   | ^^^^^^^^^ help: must be of the form: `#[derive(Trait1, Trait2, ...)]`
 
 error: malformed `derive` attribute input
   --> $DIR/malformed-special-attrs.rs:10:1
    |
 LL | #[derive = ""]
-   | ^^^^^^^^^^^^^^ help: missing traits to be derived: `#[derive(Trait1, Trait2, ...)]`
+   | ^^^^^^^^^^^^^^ help: must be of the form: `#[derive(Trait1, Trait2, ...)]`
 
 error: aborting due to 4 previous errors