about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-10-14 13:21:46 +0000
committerbors <bors@rust-lang.org>2021-10-14 13:21:46 +0000
commit0a56eb11fafdd3c9d86c100b6b90505f5f9fdb00 (patch)
tree37f0352dc7c9bb2f06bdbf0728e83623b075a845 /compiler/rustc_codegen_gcc
parentc34ac8747ca96d09cb08b8f5adddead826e77c06 (diff)
parent8fc329f5d2305d2f127752e7af3a37e07a1a89dc (diff)
downloadrust-0a56eb11fafdd3c9d86c100b6b90505f5f9fdb00.tar.gz
rust-0a56eb11fafdd3c9d86c100b6b90505f5f9fdb00.zip
Auto merge of #88698 - Noble-Mushtak:master, r=nikomatsakis,oli-obk
Add check that live_region is live in sanitize_promoted

This pull request fixes #88434 by adding a check in `sanitize_promoted` to ensure that only regions which are actually live are added to the `liveness_constraints` of the `BorrowCheckContext`.

To implement this change, I needed to add a method to `LivenessValues` which gets the elements contained by a region:

    /// Returns an iterator of all the elements contained by the region `r`
    crate fn get_elements(&self, row: N) -> impl Iterator<Item = Location> + '_

Then, inside `sanitize_promoted`, we check whether the iterator returned by this method is non-empty to ensure that the region is actually live at at least one location before adding that region to the `liveness_constraints` of the `BorrowCheckContext`.

This is my first pull request to the Rust repo, so any feedback on how I can improve this pull request or if there is a better way to fix this issue would be very appreciated.
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions