diff options
Diffstat (limited to 'tests/ui/proc-macro')
| -rw-r--r-- | tests/ui/proc-macro/illegal-proc-macro-derive-use.rs | 2 | ||||
| -rw-r--r-- | tests/ui/proc-macro/illegal-proc-macro-derive-use.stderr | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/ui/proc-macro/illegal-proc-macro-derive-use.rs b/tests/ui/proc-macro/illegal-proc-macro-derive-use.rs index 4efd9e952fc..19473fb2caf 100644 --- a/tests/ui/proc-macro/illegal-proc-macro-derive-use.rs +++ b/tests/ui/proc-macro/illegal-proc-macro-derive-use.rs @@ -8,7 +8,7 @@ pub fn foo(a: proc_macro::TokenStream) -> proc_macro::TokenStream { // Issue #37590 #[proc_macro_derive(Foo)] -//~^ ERROR: the `#[proc_macro_derive]` attribute may only be used on bare functions +//~^ ERROR: attribute cannot be used on pub struct Foo { } diff --git a/tests/ui/proc-macro/illegal-proc-macro-derive-use.stderr b/tests/ui/proc-macro/illegal-proc-macro-derive-use.stderr index c0930ab7102..f01619b9195 100644 --- a/tests/ui/proc-macro/illegal-proc-macro-derive-use.stderr +++ b/tests/ui/proc-macro/illegal-proc-macro-derive-use.stderr @@ -4,11 +4,13 @@ error: the `#[proc_macro_derive]` attribute is only usable with crates of the `p LL | #[proc_macro_derive(Foo)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: the `#[proc_macro_derive]` attribute may only be used on bare functions +error: `#[proc_macro_derive]` attribute cannot be used on structs --> $DIR/illegal-proc-macro-derive-use.rs:10:1 | LL | #[proc_macro_derive(Foo)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: `#[proc_macro_derive]` can only be applied to functions error: aborting due to 2 previous errors |
