diff options
| author | Tom Martin <tom.martin1239@gmail.com> | 2023-03-26 15:59:45 +0100 |
|---|---|---|
| committer | Tom Martin <tom.martin1239@gmail.com> | 2023-03-26 16:01:25 +0100 |
| commit | 42f2be8a8c655695ecf2b56eebf023faf7d62463 (patch) | |
| tree | 494c2329fd7deff61ad2587f81456e604e0c66d9 /tests | |
| parent | 89c2e3d3d75486e52473de3ae38f0ca6efeffef2 (diff) | |
| download | rust-42f2be8a8c655695ecf2b56eebf023faf7d62463.tar.gz rust-42f2be8a8c655695ecf2b56eebf023faf7d62463.zip | |
Add suggestion to remove derive() if invoked macro is non-derive
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/macros/macro-path-prelude-fail-4.stderr | 6 | ||||
| -rw-r--r-- | tests/ui/proc-macro/macro-namespace-reserved-2.stderr | 12 | ||||
| -rw-r--r-- | tests/ui/tool-attributes/tool-attributes-misplaced-2.stderr | 6 |
3 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/macros/macro-path-prelude-fail-4.stderr b/tests/ui/macros/macro-path-prelude-fail-4.stderr index dfd6818b678..fb4e19d8565 100644 --- a/tests/ui/macros/macro-path-prelude-fail-4.stderr +++ b/tests/ui/macros/macro-path-prelude-fail-4.stderr @@ -3,6 +3,12 @@ error: expected derive macro, found built-in attribute `inline` | LL | #[derive(inline)] | ^^^^^^ not a derive macro + | +help: remove the surrounding "derive()": + --> $DIR/macro-path-prelude-fail-4.rs:1:3 + | +LL | #[derive(inline)] + | ^^^^^^^ ^ error: aborting due to previous error diff --git a/tests/ui/proc-macro/macro-namespace-reserved-2.stderr b/tests/ui/proc-macro/macro-namespace-reserved-2.stderr index 633a6c6a0d3..6e7adc2e3b1 100644 --- a/tests/ui/proc-macro/macro-namespace-reserved-2.stderr +++ b/tests/ui/proc-macro/macro-namespace-reserved-2.stderr @@ -57,6 +57,12 @@ error: expected derive macro, found attribute macro `my_macro_attr` | LL | #[derive(my_macro_attr)] | ^^^^^^^^^^^^^ not a derive macro + | +help: remove the surrounding "derive()": + --> $DIR/macro-namespace-reserved-2.rs:53:3 + | +LL | #[derive(my_macro_attr)] + | ^^^^^^^ ^ error: can't use a procedural macro from the same crate that defines it --> $DIR/macro-namespace-reserved-2.rs:56:10 @@ -87,6 +93,12 @@ error: expected derive macro, found macro `crate::my_macro` | LL | #[derive(crate::my_macro)] | ^^^^^^^^^^^^^^^ not a derive macro + | +help: remove the surrounding "derive()": + --> $DIR/macro-namespace-reserved-2.rs:50:3 + | +LL | #[derive(crate::my_macro)] + | ^^^^^^^ ^ error: cannot find macro `my_macro_attr` in this scope --> $DIR/macro-namespace-reserved-2.rs:28:5 diff --git a/tests/ui/tool-attributes/tool-attributes-misplaced-2.stderr b/tests/ui/tool-attributes/tool-attributes-misplaced-2.stderr index 6d0f826e621..6befa99f583 100644 --- a/tests/ui/tool-attributes/tool-attributes-misplaced-2.stderr +++ b/tests/ui/tool-attributes/tool-attributes-misplaced-2.stderr @@ -3,6 +3,12 @@ error: expected derive macro, found tool attribute `rustfmt::skip` | LL | #[derive(rustfmt::skip)] | ^^^^^^^^^^^^^ not a derive macro + | +help: remove the surrounding "derive()": + --> $DIR/tool-attributes-misplaced-2.rs:1:3 + | +LL | #[derive(rustfmt::skip)] + | ^^^^^^^ ^ error: expected macro, found tool attribute `rustfmt::skip` --> $DIR/tool-attributes-misplaced-2.rs:5:5 |
