visit_place_base is just visit_local
This commit is contained in:
parent
45d050cde2
commit
15ecfe65a8
@ -204,7 +204,7 @@ impl<Bx: BuilderMethods<'a, 'tcx>> 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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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) {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user