Warn on pointless #[derive] in more places
This fixes the regression in #49934 and ensures that unused `#[derive]`s on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. For `#[derive]` on macro invocations it has a hardcoded warning since linting occurs after expansion. This also adds regression testing 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