Skip to content

Commit b7d42d6

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

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
@@ -1118,11 +1118,9 @@ macro_rules! visit_place_fns {
11181118
context: PlaceContext,
11191119
location: Location,
11201120
) {
1121-
// FIXME: Use PlaceRef::iter_projections, once that exists.
1122-
let mut cursor = place_ref.projection;
1123-
while let &[ref proj_base @ .., elem] = cursor {
1124-
cursor = proj_base;
1125-
self.visit_projection_elem(place_ref.local, cursor, elem, context, location);
1121+
for (base, elem) in place_ref.iter_projections().rev() {
1122+
let base_proj = base.projection;
1123+
self.visit_projection_elem(place_ref.local, base_proj, elem, context, location);
11261124
}
11271125
}
11281126

0 commit comments

Comments
 (0)