Skip to content

Commit

Permalink
Rollup merge of rust-lang#99154 - rosehuds:master, r=cjgillot
Browse files Browse the repository at this point in the history
use PlaceRef::iter_projections to fix old FIXME

I added this function in 53481a5
  • Loading branch information
Dylan-DPC authored Jul 12, 2022
2 parents 8a770e0 + d84f739 commit b7d42d6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions compiler/rustc_middle/src/mir/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1118,11 +1118,9 @@ macro_rules! visit_place_fns {
context: PlaceContext,
location: Location,
) {
// 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(place_ref.local, cursor, elem, context, location);
for (base, elem) in place_ref.iter_projections().rev() {
let base_proj = base.projection;
self.visit_projection_elem(place_ref.local, base_proj, elem, context, location);
}
}

Expand Down

0 comments on commit b7d42d6

Please sign in to comment.