use crate::utils::{span_lint, span_lint_and_then};
use rustc_ast::ast::{
- Arm, AssocItem, AssocItemKind, Attribute, Block, FnDecl, Item, ItemKind, Local, Pat, PatKind,
+ Arm, AssocItem, AssocItemKind, Attribute, Block, FnDecl, FnKind, Item, ItemKind, Local, Pat,
+ PatKind,
};
use rustc_ast::visit::{walk_block, walk_expr, walk_pat, Visitor};
use rustc_lint::{EarlyContext, EarlyLintPass};
);
return;
}
+ if interned_name.starts_with('_') {
+ // these bindings are typically unused or represent an ignored portion of a destructuring pattern
+ return;
+ }
let count = interned_name.chars().count();
if count < 3 {
if count == 1 {
return;
}
- if let ItemKind::Fn(_, ref sig, _, Some(ref blk)) = item.kind {
+ if let ItemKind::Fn(box FnKind(_, ref sig, _, Some(ref blk))) = item.kind {
do_check(self, cx, &item.attrs, &sig.decl, blk);
}
}
return;
}
- if let AssocItemKind::Fn(_, ref sig, _, Some(ref blk)) = item.kind {
+ if let AssocItemKind::Fn(box FnKind(_, ref sig, _, Some(ref blk))) = item.kind {
do_check(self, cx, &item.attrs, &sig.decl, blk);
}
}
if let Some(b2) = b_chars.next() {
// check if there's just one character inserted
return a != b2 || a_chars.ne(b_chars);
- } else {
- // tuple
- // ntuple
- return true;
}
+ // tuple
+ // ntuple
+ return true;
}
// for item in items
true