rust/compiler/rustc_borrowck/src
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
..
constraints
diagnostics clippy::complexity fixes 2021-10-08 20:07:44 +02:00
region_infer Add check that region is live in sanitize_promoted 2021-10-07 18:20:23 -04:00
type_check Auto merge of #88698 - Noble-Mushtak:master, r=nikomatsakis,oli-obk 2021-10-14 13:21:46 +00:00
borrow_set.rs
borrowck_errors.rs
constraint_generation.rs
consumers.rs Add InferCtxt::with_opaque_type_inference to get_body_with_borrowck_facts 2021-10-06 19:07:56 -07:00
dataflow.rs clippy::complexity fixes 2021-10-08 20:07:44 +02:00
def_use.rs
facts.rs
invalidation.rs Introduce Rvalue::ShallowInitBox 2021-09-25 01:08:41 +01:00
lib.rs Stabilize const_panic 2021-10-04 02:33:33 -04:00
location.rs
member_constraints.rs Replace Fn impls with RPIT impls in rustc_index 2021-10-03 17:50:53 +02:00
nll.rs More tracing instrumentation 2021-09-28 12:28:22 +00:00
path_utils.rs
place_ext.rs
places_conflict.rs
prefixes.rs
renumber.rs More tracing instrumentation 2021-09-28 12:28:22 +00:00
universal_regions.rs
used_muts.rs