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 https://github.com/rust-lang/rust/pull/69589.
This commit is contained in:
commit
8ebca242bc
18 changed files with 29 additions and 93 deletions
|
@ -880,12 +880,6 @@ impl<'a> MutVisitor for ReplaceBodyWithLoop<'a, '_> {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
// in general the pretty printer processes unexpanded code, so
|
||||
// we override the default `visit_mac` method which panics.
|
||||
fn visit_mac(&mut self, mac: &mut ast::MacCall) {
|
||||
noop_visit_mac(mac, self)
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns a version string such as "rustc 1.46.0 (04488afe3 2020-08-24)"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue