use crate::mir::*;
use crate::ty::subst::SubstsRef;
use crate::ty::{CanonicalUserTypeAnnotation, Ty};
-use syntax_pos::Span;
+use rustc_span::Span;
// # The MIR Visitor
//
}
fn visit_place_base(&mut self,
- base: & $($mutability)? PlaceBase<'tcx>,
+ local: & $($mutability)? Local,
context: PlaceContext,
location: Location) {
- self.super_place_base(base, context, location);
+ self.super_place_base(local, context, location);
}
visit_place_fns!($($mutability)?);
}
fn super_place_base(&mut self,
- place_base: & $($mutability)? PlaceBase<'tcx>,
+ local: & $($mutability)? Local,
context: PlaceContext,
location: Location) {
- match place_base {
- PlaceBase::Local(local) => {
- self.visit_local(local, context, location);
- }
- PlaceBase::Static(box Static { kind: _, ty, def_id: _ }) => {
- self.visit_ty(& $($mutability)? *ty, TyContext::Location(location));
- }
- }
+ self.visit_local(local, context, location);
}
fn super_local_decl(&mut self,
context: PlaceContext,
location: Location,
) {
- self.visit_place_base(&mut place.base, context, location);
+ self.visit_place_base(&mut place.local, context, location);
if let Some(new_projection) = self.process_projection(&place.projection) {
place.projection = self.tcx().intern_place_elems(&new_projection);
() => (
fn visit_projection(
&mut self,
- base: &PlaceBase<'tcx>,
+ local: &Local,
projection: &[PlaceElem<'tcx>],
context: PlaceContext,
location: Location,
) {
- self.super_projection(base, projection, context, location);
+ self.super_projection(local, projection, context, location);
}
fn visit_projection_elem(
&mut self,
- base: &PlaceBase<'tcx>,
+ local: &Local,
proj_base: &[PlaceElem<'tcx>],
elem: &PlaceElem<'tcx>,
context: PlaceContext,
location: Location,
) {
- self.super_projection_elem(base, proj_base, elem, context, location);
+ self.super_projection_elem(local, proj_base, elem, context, location);
}
fn super_place(
};
}
- self.visit_place_base(&place.base, context, location);
+ self.visit_place_base(&place.local, context, location);
- self.visit_projection(&place.base,
+ self.visit_projection(&place.local,
&place.projection,
context,
location);
fn super_projection(
&mut self,
- base: &PlaceBase<'tcx>,
+ local: &Local,
projection: &[PlaceElem<'tcx>],
context: PlaceContext,
location: Location,
let mut cursor = projection;
while let [proj_base @ .., elem] = cursor {
cursor = proj_base;
- self.visit_projection_elem(base, cursor, elem, context, location);
+ self.visit_projection_elem(local, cursor, elem, context, location);
}
}
fn super_projection_elem(
&mut self,
- _base: &PlaceBase<'tcx>,
+ _local: &Local,
_proj_base: &[PlaceElem<'tcx>],
elem: &PlaceElem<'tcx>,
_context: PlaceContext,