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:
Dylan DPC 2020-11-09 19:06:55 +01:00 committed by GitHub
commit 8ebca242bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 29 additions and 93 deletions

View file

@ -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)"