diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-11-09 19:06:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-09 19:06:55 +0100 |
| commit | 8ebca242bc6797647147b1c178f0620f867710ac (patch) | |
| tree | a7b2dbfa2894ca7bd5048307adc8610b0f8c65a0 /compiler/rustc_parse/src/parser | |
| parent | ee1fedf392518ede3ff9940d6ff83ff280b59000 (diff) | |
| parent | 90fafc8c8ff680fc631a44230d8352d7911e70f2 (diff) | |
| download | rust-8ebca242bc6797647147b1c178f0620f867710ac.tar.gz rust-8ebca242bc6797647147b1c178f0620f867710ac.zip | |
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.
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/pat.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/compiler/rustc_parse/src/parser/pat.rs b/compiler/rustc_parse/src/parser/pat.rs index 196790a0ab3..ee9a6dca5ad 100644 --- a/compiler/rustc_parse/src/parser/pat.rs +++ b/compiler/rustc_parse/src/parser/pat.rs @@ -1,6 +1,6 @@ use super::{Parser, PathStyle}; use crate::{maybe_recover_from_interpolated_ty_qpath, maybe_whole}; -use rustc_ast::mut_visit::{noop_visit_mac, noop_visit_pat, MutVisitor}; +use rustc_ast::mut_visit::{noop_visit_pat, MutVisitor}; use rustc_ast::ptr::P; use rustc_ast::token; use rustc_ast::{self as ast, AttrVec, Attribute, FieldPat, MacCall, Pat, PatKind, RangeEnd}; @@ -570,10 +570,6 @@ impl<'a> Parser<'a> { fn make_all_value_bindings_mutable(pat: &mut P<Pat>) -> bool { struct AddMut(bool); impl MutVisitor for AddMut { - fn visit_mac(&mut self, mac: &mut MacCall) { - noop_visit_mac(mac, self); - } - fn visit_pat(&mut self, pat: &mut P<Pat>) { if let PatKind::Ident(BindingMode::ByValue(m @ Mutability::Not), ..) = &mut pat.kind { |
