Add suggestion to remove derive() if invoked macro is non-derive

This commit is contained in:
Tom Martin 2023-03-26 15:59:45 +01:00
parent 89c2e3d3d7
commit 42f2be8a8c
No known key found for this signature in database
GPG key ID: 73A733F9629F5AC5
4 changed files with 41 additions and 5 deletions

View file

@ -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

View file

@ -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

View file

@ -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