diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-07-16 18:09:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-16 18:09:13 +0200 |
| commit | 862852fd339af688137b7d2d1c8ae6fd348a6716 (patch) | |
| tree | 0e3bb3bb84f54c598e1f86dbcc7f82687271dc06 | |
| parent | 8fd1df8c5f8d8928a4957585c3e56047e0a796a7 (diff) | |
| parent | 117ff0a4fd11c5a71766ce76bf4b4467abd7ddf1 (diff) | |
| download | rust-862852fd339af688137b7d2d1c8ae6fd348a6716.tar.gz rust-862852fd339af688137b7d2d1c8ae6fd348a6716.zip | |
Rollup merge of #127817 - oli-obk:mut_visitor_fix, r=petrochenkov
Fix a bunch of sites that were walking instead of visiting, making it impossible for visitor impls to look at these values This doesn't affects anything right now, but a `MutVisitor` impl could be surprised by this. The reason this doesn't affect anything is that no one overrrides `visit_lifetime` or `visit_param_bounds` currently.
| -rw-r--r-- | compiler/rustc_ast/src/mut_visit.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_ast/src/mut_visit.rs b/compiler/rustc_ast/src/mut_visit.rs index 1c1163551db..39d0f2c7305 100644 --- a/compiler/rustc_ast/src/mut_visit.rs +++ b/compiler/rustc_ast/src/mut_visit.rs @@ -482,7 +482,7 @@ pub fn noop_visit_ty<T: MutVisitor>(ty: &mut P<Ty>, vis: &mut T) { TyKind::Slice(ty) => vis.visit_ty(ty), TyKind::Ptr(mt) => vis.visit_mt(mt), TyKind::Ref(lt, mt) => { - visit_opt(lt, |lt| noop_visit_lifetime(lt, vis)); + visit_opt(lt, |lt| vis.visit_lifetime(lt)); vis.visit_mt(mt); } TyKind::BareFn(bft) => { @@ -925,7 +925,7 @@ pub fn noop_flat_map_generic_param<T: MutVisitor>( vis.visit_id(id); visit_attrs(attrs, vis); vis.visit_ident(ident); - visit_vec(bounds, |bound| noop_visit_param_bound(bound, vis)); + visit_vec(bounds, |bound| vis.visit_param_bound(bound)); match kind { GenericParamKind::Lifetime => {} GenericParamKind::Type { default } => { @@ -983,7 +983,7 @@ fn noop_visit_where_predicate<T: MutVisitor>(pred: &mut WherePredicate, vis: &mu } WherePredicate::RegionPredicate(rp) => { let WhereRegionPredicate { span, lifetime, bounds } = rp; - noop_visit_lifetime(lifetime, vis); + vis.visit_lifetime(lifetime); visit_vec(bounds, |bound| noop_visit_param_bound(bound, vis)); vis.visit_span(span); } |
