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
|
@ -270,15 +270,9 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
|
|||
self.check_id(id);
|
||||
}
|
||||
|
||||
fn visit_mac(&mut self, mac: &'a ast::MacCall) {
|
||||
// FIXME(#54110): So, this setup isn't really right. I think
|
||||
// that (a) the librustc_ast visitor ought to be doing this as
|
||||
// part of `walk_mac`, and (b) we should be calling
|
||||
// `visit_path`, *but* that would require a `NodeId`, and I
|
||||
// want to get #53686 fixed quickly. -nmatsakis
|
||||
ast_visit::walk_path(self, &mac.path);
|
||||
|
||||
fn visit_mac_call(&mut self, mac: &'a ast::MacCall) {
|
||||
run_early_pass!(self, check_mac, mac);
|
||||
ast_visit::walk_mac(self, mac);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue