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:
bors
2018-04-30 00:18:49 +00:00
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,
}
}