File tree 1 file changed +6
-5
lines changed
src/librustc_mir/transform
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -615,18 +615,19 @@ fn compute_storage_conflicts(
615
615
continue;
616
616
}
617
617
618
- for (statement_index, _) in data.statements.iter().enumerate() {
618
+ // Observe the dataflow state *before* all possible locations (statement or terminator) in
619
+ // each basic block...
620
+ for statement_index in 0..=data.statements.len() {
619
621
let loc = Location { block, statement_index };
620
622
trace!("record conflicts at {:?}", loc);
621
623
init.seek_before_primary_effect(loc);
622
624
borrowed.seek_before_primary_effect(loc);
623
625
record_conflicts_at_curr_loc(&mut local_conflicts, &init, &borrowed);
624
626
}
625
627
626
- // We need to look for conflicts at the end of the block as well, otherwise we would not
627
- // observe the dataflow state after the terminator effect is applied. As long as neither
628
- // `init` nor `borrowed` has a "before" effect, we will observe all possible dataflow
629
- // states here or in the loop above.
628
+ // ...and then observe the state *after* the terminator effect is applied. As long as
629
+ // neither `init` nor `borrowed` has a "before" effect, we will observe all possible
630
+ // dataflow states here or in the loop above.
630
631
trace!("record conflicts at end of {:?}", block);
631
632
init.seek_to_block_end(block);
632
633
borrowed.seek_to_block_end(block);
You can’t perform that action at this time.
0 commit comments