rustc_ast: Do not panic by default when visiting macro calls
This commit is contained in:
parent
0cd1516696
commit
3237b3886c
16 changed files with 8 additions and 71 deletions
|
@ -547,11 +547,6 @@ impl<'a> MutVisitor for StripUnconfigured<'a> {
|
|||
noop_flat_map_assoc_item(configure!(self, item), self)
|
||||
}
|
||||
|
||||
fn visit_mac(&mut self, _mac: &mut ast::MacCall) {
|
||||
// Don't configure interpolated AST (cf. issue #34171).
|
||||
// Interpolated AST will get configured once the surrounding tokens are parsed.
|
||||
}
|
||||
|
||||
fn visit_pat(&mut self, pat: &mut P<ast::Pat>) {
|
||||
self.configure_pat(pat);
|
||||
noop_visit_pat(pat, self)
|
||||
|
|
|
@ -850,8 +850,6 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
|
|||
|
||||
visit::walk_item(self, item);
|
||||
}
|
||||
|
||||
fn visit_mac(&mut self, _: &'ast ast::MacCall) {}
|
||||
}
|
||||
|
||||
if !self.cx.ecfg.proc_macro_hygiene() {
|
||||
|
|
|
@ -27,10 +27,6 @@ impl MutVisitor for Marker {
|
|||
fn visit_span(&mut self, span: &mut Span) {
|
||||
*span = span.apply_mark(self.0, self.1)
|
||||
}
|
||||
|
||||
fn visit_mac(&mut self, mac: &mut MacCall) {
|
||||
mut_visit::noop_visit_mac(mac, self)
|
||||
}
|
||||
}
|
||||
|
||||
/// An iterator over the token trees in a delimited token tree (`{ ... }`) or a sequence (`$(...)`).
|
||||
|
|
|
@ -21,9 +21,6 @@ impl MutVisitor for ToZzIdentMutVisitor {
|
|||
fn visit_ident(&mut self, ident: &mut Ident) {
|
||||
*ident = Ident::from_str("zz");
|
||||
}
|
||||
fn visit_mac(&mut self, mac: &mut ast::MacCall) {
|
||||
mut_visit::noop_visit_mac(mac, self)
|
||||
}
|
||||
}
|
||||
|
||||
// Maybe add to `expand.rs`.
|
||||
|
|
|
@ -386,8 +386,4 @@ impl<'a, 'b> MutVisitor for PlaceholderExpander<'a, 'b> {
|
|||
|item| !matches!(item.kind, ast::ItemKind::MacCall(_) if !self.cx.ecfg.keep_macs),
|
||||
);
|
||||
}
|
||||
|
||||
fn visit_mac(&mut self, _mac: &mut ast::MacCall) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue