Skip to content

Commit 01c2421

Browse files
authored
Rollup merge of #99154 - rosehuds:master, r=cjgillot
use PlaceRef::iter_projections to fix old FIXME I added this function in 53481a5
2 parents c0bcbe8 + d84f739 commit 01c2421

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

compiler/rustc_middle/src/mir/visit.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1111,11 +1111,9 @@ macro_rules! visit_place_fns {
11111111
context: PlaceContext,
11121112
location: Location,
11131113
) {
1114-
// FIXME: Use PlaceRef::iter_projections, once that exists.
1115-
let mut cursor = place_ref.projection;
1116-
while let &[ref proj_base @ .., elem] = cursor {
1117-
cursor = proj_base;
1118-
self.visit_projection_elem(place_ref.local, cursor, elem, context, location);
1114+
for (base, elem) in place_ref.iter_projections().rev() {
1115+
let base_proj = base.projection;
1116+
self.visit_projection_elem(place_ref.local, base_proj, elem, context, location);
11191117
}
11201118
}
11211119

0 commit comments

Comments
 (0)