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:
Austin Bonander
2018-04-17 23:19:21 -07:00
parent b91e6a2672
commit f16d2ff7ec
7 changed files with 184 additions and 16 deletions

View File

@@ -821,7 +821,7 @@ impl Stmt {
pub fn is_item(&self) -> bool {
match self.node {
StmtKind::Local(_) => true,
StmtKind::Item(_) => true,
_ => false,
}
}