Auto merge of #50092 - abonander:issue-49934, r=petrochenkov
Warn on pointless #[derive] in more places This fixes the regression in #49934 and ensures that unused `#[derive]` invocations on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. There is a separate warning hardcoded for `#[derive]` on macro invocations since linting (even the early-lint pass) occurs after expansion. This also adds regression tests for some nodes that were already warning properly. closes #49934
This commit is contained in:
@@ -821,7 +821,7 @@ impl Stmt {
|
||||
|
||||
pub fn is_item(&self) -> bool {
|
||||
match self.node {
|
||||
StmtKind::Local(_) => true,
|
||||
StmtKind::Item(_) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user