File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
src/librustc_mir/transform Expand file tree Collapse file tree 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(
615615 continue ;
616616 }
617617
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 ( ) {
619621 let loc = Location { block, statement_index } ;
620622 trace ! ( "record conflicts at {:?}" , loc) ;
621623 init. seek_before_primary_effect ( loc) ;
622624 borrowed. seek_before_primary_effect ( loc) ;
623625 record_conflicts_at_curr_loc ( & mut local_conflicts, & init, & borrowed) ;
624626 }
625627
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.
630631 trace ! ( "record conflicts at end of {:?}" , block) ;
631632 init. seek_to_block_end ( block) ;
632633 borrowed. seek_to_block_end ( block) ;
You can’t perform that action at this time.
0 commit comments