Skip to content
/ rust Public
forked from rust-lang/rust

Commit a74f3fb

Browse files
committed
Iterate directly on block indices in rustc_mir_transform
1 parent 6041d18 commit a74f3fb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compiler/rustc_mir_transform/src/check_pointers.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ pub(crate) fn check_pointers<'a, 'tcx, F>(
7070
// statements/blocks after. Iterating or visiting the MIR in order would require updating
7171
// our current location after every insertion. By iterating backwards, we dodge this issue:
7272
// The only Locations that an insertion changes have already been handled.
73-
for block in (0..basic_blocks.len()).rev() {
74-
let block = block.into();
73+
for block in basic_blocks.indices().rev() {
7574
for statement_index in (0..basic_blocks[block].statements.len()).rev() {
7675
let location = Location { block, statement_index };
7776
let statement = &basic_blocks[block].statements[statement_index];

0 commit comments

Comments
 (0)