-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Add suggestion to remove derive() if invoked macro is non-derive
#109638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
42f2be8
10c3644
ed84d1d
86230dc
56207b8
be44169
5c5c3c9
18388c9
668a629
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,14 @@ error: expected derive macro, found built-in attribute `inline` | |
| | | ||
| LL | #[derive(inline)] | ||
| | ^^^^^^ not a derive macro | ||
| | | ||
| help: Remove from the surrounding `derive()` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add a new test case that has some of the trickier cases for this change? e.g. two derives, macro (to confirm it doesn't trigger), etc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I can tell, this isn't valid. Was there something else you meant with macro? macro_rules! foo {
() => {
Debug
};
}
#[derive(foo!())]
struct V;There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. macro_rules! foo {
($foo:expr) => {
#[derive($foo)]
struct V;
};
}Something more like this? |
||
| --> $DIR/macro-path-prelude-fail-4.rs:1:10 | ||
| | | ||
| LL | #[derive(inline)] | ||
| | ^^^^^^ | ||
| = help: Add as non-Derive macro | ||
| `#[inline]` | ||
|
|
||
| error: aborting due to previous error | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.