From 15ecfe65a8f3aa54ab2af11993de7602c9431082 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Tue, 21 Apr 2020 17:11:00 -0300 Subject: [PATCH] visit_place_base is just visit_local --- src/librustc_codegen_ssa/mir/analyze.rs | 2 +- src/librustc_middle/mir/visit.rs | 18 ++---------------- src/librustc_mir/monomorphize/collector.rs | 2 +- .../transform/check_consts/validation.rs | 9 ++++----- src/librustc_mir/transform/generator.rs | 4 ++-- 5 files changed, 10 insertions(+), 25 deletions(-) diff --git a/src/librustc_codegen_ssa/mir/analyze.rs b/src/librustc_codegen_ssa/mir/analyze.rs index 71b9ff26140..5ce60b8b3d4 100644 --- a/src/librustc_codegen_ssa/mir/analyze.rs +++ b/src/librustc_codegen_ssa/mir/analyze.rs @@ -204,7 +204,7 @@ impl> LocalAnalyzer<'mir, 'a, 'tcx, Bx> { }; } - self.visit_place_base(&place_ref.local, context, location); + self.visit_local(&place_ref.local, context, location); self.visit_projection(place_ref.local, place_ref.projection, context, location); } } diff --git a/src/librustc_middle/mir/visit.rs b/src/librustc_middle/mir/visit.rs index efc12138d34..63352460536 100644 --- a/src/librustc_middle/mir/visit.rs +++ b/src/librustc_middle/mir/visit.rs @@ -163,13 +163,6 @@ macro_rules! make_mir_visitor { self.super_place(place, context, location); } - fn visit_place_base(&mut self, - local: & $($mutability)? Local, - context: PlaceContext, - location: Location) { - self.super_place_base(local, context, location); - } - visit_place_fns!($($mutability)?); fn visit_constant(&mut self, @@ -710,13 +703,6 @@ macro_rules! make_mir_visitor { ); } - fn super_place_base(&mut self, - local: & $($mutability)? Local, - context: PlaceContext, - location: Location) { - self.visit_local(local, context, location); - } - fn super_local_decl(&mut self, local: Local, local_decl: & $($mutability)? LocalDecl<'tcx>) { @@ -847,7 +833,7 @@ macro_rules! visit_place_fns { context: PlaceContext, location: Location, ) { - self.visit_place_base(&mut place.local, context, location); + self.visit_local(&mut place.local, context, location); if let Some(new_projection) = self.process_projection(&place.projection, location) { place.projection = self.tcx().intern_place_elems(&new_projection); @@ -936,7 +922,7 @@ macro_rules! visit_place_fns { }; } - self.visit_place_base(&place.local, context, location); + self.visit_local(&place.local, context, location); self.visit_projection(place.local, &place.projection, context, location); } diff --git a/src/librustc_mir/monomorphize/collector.rs b/src/librustc_mir/monomorphize/collector.rs index ea648ebf34e..5c94257c31a 100644 --- a/src/librustc_mir/monomorphize/collector.rs +++ b/src/librustc_mir/monomorphize/collector.rs @@ -648,7 +648,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> { self.super_terminator_kind(kind, location); } - fn visit_place_base( + fn visit_local( &mut self, _place_local: &Local, _context: mir::visit::PlaceContext, diff --git a/src/librustc_mir/transform/check_consts/validation.rs b/src/librustc_mir/transform/check_consts/validation.rs index cee98e9b299..282f37e8fc5 100644 --- a/src/librustc_mir/transform/check_consts/validation.rs +++ b/src/librustc_mir/transform/check_consts/validation.rs @@ -276,7 +276,7 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> { PlaceContext::MutatingUse(MutatingUseContext::Borrow) } }; - self.visit_place_base(&place.local, ctx, location); + self.visit_local(&place.local, ctx, location); self.visit_projection(place.local, reborrowed_proj, ctx, location); return; } @@ -289,7 +289,7 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> { } Mutability::Mut => PlaceContext::MutatingUse(MutatingUseContext::AddressOf), }; - self.visit_place_base(&place.local, ctx, location); + self.visit_local(&place.local, ctx, location); self.visit_projection(place.local, reborrowed_proj, ctx, location); return; } @@ -386,14 +386,13 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> { } } - fn visit_place_base(&mut self, place_local: &Local, context: PlaceContext, location: Location) { + fn visit_local(&mut self, place_local: &Local, context: PlaceContext, location: Location) { trace!( - "visit_place_base: place_local={:?} context={:?} location={:?}", + "visit_local: place_local={:?} context={:?} location={:?}", place_local, context, location, ); - self.super_place_base(place_local, context, location); } fn visit_operand(&mut self, op: &Operand<'tcx>, location: Location) { diff --git a/src/librustc_mir/transform/generator.rs b/src/librustc_mir/transform/generator.rs index 44928951045..257b6b4a5cf 100644 --- a/src/librustc_mir/transform/generator.rs +++ b/src/librustc_mir/transform/generator.rs @@ -115,7 +115,7 @@ impl<'tcx> MutVisitor<'tcx> for DerefArgVisitor<'tcx> { self.tcx, ); } else { - self.visit_place_base(&mut place.local, context, location); + self.visit_local(&mut place.local, context, location); for elem in place.projection.iter() { if let PlaceElem::Index(local) = elem { @@ -154,7 +154,7 @@ impl<'tcx> MutVisitor<'tcx> for PinArgVisitor<'tcx> { self.tcx, ); } else { - self.visit_place_base(&mut place.local, context, location); + self.visit_local(&mut place.local, context, location); for elem in place.projection.iter() { if let PlaceElem::Index(local) = elem {