Skip to content

Commit 6294300

Browse files
authoredNov 9, 2020
Rollup merge of #78710 - petrochenkov:macvisit, r=davidtwco
rustc_ast: Do not panic by default when visiting macro calls Panicking by default made sense when we didn't have HIR or MIR and everything worked on AST, but now all AST visitors run early and majority of them have to deal with macro calls, often by ignoring them. The second commit renames `visit_mac` to `visit_mac_call`, the corresponding structures were renamed earlier in rust-lang/rust#69589.
2 parents 3424419 + c2a769f commit 6294300

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed
 

‎clippy_lints/src/non_expressive_names.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::utils::{span_lint, span_lint_and_then};
22
use rustc_ast::ast::{
3-
Arm, AssocItem, AssocItemKind, Attribute, Block, FnDecl, Item, ItemKind, Local, MacCall, Pat, PatKind,
3+
Arm, AssocItem, AssocItemKind, Attribute, Block, FnDecl, Item, ItemKind, Local, Pat, PatKind,
44
};
55
use rustc_ast::visit::{walk_block, walk_expr, walk_pat, Visitor};
66
use rustc_lint::{EarlyContext, EarlyLintPass};
@@ -150,9 +150,6 @@ impl<'a, 'tcx, 'b> Visitor<'tcx> for SimilarNamesNameVisitor<'a, 'tcx, 'b> {
150150
_ => walk_pat(self, pat),
151151
}
152152
}
153-
fn visit_mac(&mut self, _mac: &MacCall) {
154-
// do not check macs
155-
}
156153
}
157154

158155
#[must_use]
@@ -357,9 +354,6 @@ impl<'a, 'tcx> Visitor<'tcx> for SimilarNamesLocalVisitor<'a, 'tcx> {
357354
fn visit_item(&mut self, _: &Item) {
358355
// do not recurse into inner items
359356
}
360-
fn visit_mac(&mut self, _mac: &MacCall) {
361-
// do not check macs
362-
}
363357
}
364358

365359
impl EarlyLintPass for NonExpressiveNames {

0 commit comments

Comments
 (0)
Please sign in to comment.