rust/compiler
bors 0a56eb11fa 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.
2021-10-14 13:21:46 +00:00
..
2021-10-10 15:38:19 +02:00
2021-10-08 19:32:16 +03:00
2021-10-03 16:08:50 +02:00
2021-10-14 07:07:34 +00:00
2021-10-10 19:59:36 +01:00
2021-10-10 15:38:19 +02:00
2021-10-06 19:36:52 +00:00
2021-10-10 15:38:19 +02:00
2021-10-10 15:38:19 +02:00
2021-10-07 11:29:47 -07:00
2021-10-07 22:31:33 +02:00
2021-10-10 15:38:19 +02:00
2021-10-03 16:08:54 +02:00
2021-10-08 20:07:44 +02:00