Fix fallout in similar_names
This commit is contained in:
parent
485229c4a3
commit
efd3dcff97
@ -5,6 +5,7 @@
|
||||
use rustc_ast::attr;
|
||||
use rustc_ast::visit::{walk_block, walk_expr, walk_pat, Visitor};
|
||||
use rustc_lint::{EarlyContext, EarlyLintPass};
|
||||
use rustc_middle::lint::in_external_macro;
|
||||
use rustc_session::{declare_tool_lint, impl_lint_pass};
|
||||
use rustc_span::source_map::Span;
|
||||
use rustc_span::symbol::SymbolStr;
|
||||
@ -354,12 +355,20 @@ fn visit_mac(&mut self, _mac: &MacCall) {
|
||||
|
||||
impl EarlyLintPass for NonExpressiveNames {
|
||||
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
|
||||
if in_external_macro(cx.sess, item.span) {
|
||||
return;
|
||||
}
|
||||
|
||||
if let ItemKind::Fn(_, ref sig, _, Some(ref blk)) = item.kind {
|
||||
do_check(self, cx, &item.attrs, &sig.decl, blk);
|
||||
}
|
||||
}
|
||||
|
||||
fn check_impl_item(&mut self, cx: &EarlyContext<'_>, item: &AssocItem) {
|
||||
if in_external_macro(cx.sess, item.span) {
|
||||
return;
|
||||
}
|
||||
|
||||
if let AssocItemKind::Fn(_, ref sig, _, Some(ref blk)) = item.kind {
|
||||
do_check(self, cx, &item.attrs, &sig.decl, blk);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user