Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 90da274

Browse files
Add comment explaining the extra record_conflicts
1 parent 157631b commit 90da274

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc_mir/transform/generator.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,10 @@ fn compute_storage_conflicts(
622622
record_conflicts_at_curr_loc(&mut local_conflicts, &init, &borrowed);
623623
}
624624

625+
// We need to look for conflicts at the end of the block as well, otherwise we would not
626+
// observe the dataflow state after the terminator effect is applied. As long as neither
627+
// `init` nor `borrowed` has a "before" effect, we will observe all possible dataflow
628+
// states here or in the loop above.
625629
trace!("record conflicts at end of {:?}", block);
626630
init.seek_to_block_end(block);
627631
borrowed.seek_to_block_end(block);

0 commit comments

Comments
 (0)