diff options
| author | Austin Bonander <austin.bonander@gmail.com> | 2018-04-17 23:19:21 -0700 |
|---|---|---|
| committer | Austin Bonander <austin.bonander@gmail.com> | 2018-04-29 16:01:41 -0700 |
| commit | f16d2ff7ec184de179f22322f1decd96f94ef8a7 (patch) | |
| tree | d0787ffb3072a91cf8bc0c567bbf099a84ef71ff /src/libsyntax/ast.rs | |
| parent | b91e6a2672a6f69e404d87fa62a5900a390622cf (diff) | |
| download | rust-f16d2ff7ec184de179f22322f1decd96f94ef8a7.tar.gz rust-f16d2ff7ec184de179f22322f1decd96f94ef8a7.zip | |
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
Diffstat (limited to 'src/libsyntax/ast.rs')
| -rw-r--r-- | src/libsyntax/ast.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 91c9a1524e1..46e3e20f58e 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -821,7 +821,7 @@ impl Stmt { pub fn is_item(&self) -> bool { match self.node { - StmtKind::Local(_) => true, + StmtKind::Item(_) => true, _ => false, } } |
