Skip to content

Commit

Permalink
Add comment explaining the extra record_conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ecstatic-morse committed May 20, 2020
1 parent 157631b commit 90da274
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustc_mir/transform/generator.rs
Expand Up @@ -622,6 +622,10 @@ fn compute_storage_conflicts(
record_conflicts_at_curr_loc(&mut local_conflicts, &init, &borrowed);
}

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

0 comments on commit 90da274

Please sign in to comment.