mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-01 07:13:24 +03:00
make super_projection take a PlaceRef
This commit is contained in:
@@ -1002,7 +1002,7 @@ fn visit_projection(
|
||||
context: PlaceContext,
|
||||
location: Location,
|
||||
) {
|
||||
self.super_projection(place_ref.local, place_ref.projection, context, location);
|
||||
self.super_projection(place_ref, context, location);
|
||||
}
|
||||
|
||||
fn visit_projection_elem(
|
||||
@@ -1037,15 +1037,15 @@ fn super_place(&mut self, place: &Place<'tcx>, context: PlaceContext, location:
|
||||
|
||||
fn super_projection(
|
||||
&mut self,
|
||||
local: Local,
|
||||
projection: &[PlaceElem<'tcx>],
|
||||
place_ref: PlaceRef<'tcx>,
|
||||
context: PlaceContext,
|
||||
location: Location,
|
||||
) {
|
||||
let mut cursor = projection;
|
||||
// FIXME: Use PlaceRef::iter_projections, once that exists.
|
||||
let mut cursor = place_ref.projection;
|
||||
while let &[ref proj_base @ .., elem] = cursor {
|
||||
cursor = proj_base;
|
||||
self.visit_projection_elem(local, cursor, elem, context, location);
|
||||
self.visit_projection_elem(place_ref.local, cursor, elem, context, location);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -414,8 +414,7 @@ fn visit_lhs(&mut self, place: &Place<'tcx>, location: Location) {
|
||||
} else {
|
||||
// A definition. Although, it still might use other locals for indexing.
|
||||
self.super_projection(
|
||||
place.local,
|
||||
&place.projection,
|
||||
place.as_ref(),
|
||||
PlaceContext::MutatingUse(MutatingUseContext::Projection),
|
||||
location,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user