|
1 | 1 | use rustc::ty::subst::SubstsRef;
|
2 | 2 | use rustc::ty::{self, Ty, TypeFoldable};
|
3 |
| -use rustc::mir::{Body, Location, Place, PlaceElem, Promoted}; |
4 |
| -use rustc::mir::visit::{MutVisitor, PlaceContext, TyContext}; |
| 3 | +use rustc::mir::{Body, Location, PlaceElem, Promoted}; |
| 4 | +use rustc::mir::visit::{MutVisitor, TyContext}; |
5 | 5 | use rustc::infer::{InferCtxt, NLLRegionVariableOrigin};
|
6 | 6 | use rustc_index::vec::IndexVec;
|
7 | 7 |
|
@@ -62,23 +62,15 @@ impl<'a, 'tcx> MutVisitor<'tcx> for NLLVisitor<'a, 'tcx> {
|
62 | 62 | debug!("visit_ty: ty={:?}", ty);
|
63 | 63 | }
|
64 | 64 |
|
65 |
| - fn visit_place( |
| 65 | + fn process_projection_elem( |
66 | 66 | &mut self,
|
67 |
| - place: &mut Place<'tcx>, |
68 |
| - context: PlaceContext, |
69 |
| - location: Location, |
70 |
| - ) { |
71 |
| - self.visit_place_base(&mut place.base, context, location); |
72 |
| - |
73 |
| - let new_projection: Vec<_> = place.projection.iter().map(|elem| |
74 |
| - if let PlaceElem::Field(field, ty) = elem { |
75 |
| - PlaceElem::Field(*field, self.renumber_regions(ty)) |
76 |
| - } else { |
77 |
| - elem.clone() |
78 |
| - } |
79 |
| - ).collect(); |
80 |
| - |
81 |
| - place.projection = new_projection.into_boxed_slice(); |
| 67 | + elem: &PlaceElem<'tcx>, |
| 68 | + ) -> PlaceElem<'tcx> { |
| 69 | + if let PlaceElem::Field(field, ty) = elem { |
| 70 | + PlaceElem::Field(*field, self.renumber_regions(ty)) |
| 71 | + } else { |
| 72 | + elem.clone() |
| 73 | + } |
82 | 74 | }
|
83 | 75 |
|
84 | 76 | fn visit_substs(&mut self, substs: &mut SubstsRef<'tcx>, location: Location) {
|
|
0 commit comments