1
Fork 0

Implement Place::as_place_ref

This commit is contained in:
Santiago Pastorino 2019-07-02 21:01:20 +02:00
parent 98d2324875
commit e11adb13b6
2 changed files with 8 additions and 6 deletions

View file

@ -1930,6 +1930,13 @@ impl<'tcx> Place<'tcx> {
iterate_over2(place_base, place_projection, &Projections::Empty, op)
}
pub fn as_place_ref(&self) -> PlaceRef<'_, 'tcx> {
PlaceRef {
base: &self.base,
projection: &self.projection,
}
}
}
impl From<Local> for Place<'_> {

View file

@ -238,12 +238,7 @@ impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
context: PlaceContext,
location: Location) {
debug!("visit_place(place={:?}, context={:?})", place, context);
let place_ref = mir::PlaceRef {
base: &place.base,
projection: &place.projection,
};
self.process_place(&place_ref, context, location);
self.process_place(&place.as_place_ref(), context, location);
}
fn visit_local(&mut self,