0a56eb11fa
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. |
||
---|---|---|
.. | ||
constraints | ||
diagnostics | ||
region_infer | ||
type_check | ||
borrow_set.rs | ||
borrowck_errors.rs | ||
constraint_generation.rs | ||
consumers.rs | ||
dataflow.rs | ||
def_use.rs | ||
facts.rs | ||
invalidation.rs | ||
lib.rs | ||
location.rs | ||
member_constraints.rs | ||
nll.rs | ||
path_utils.rs | ||
place_ext.rs | ||
places_conflict.rs | ||
prefixes.rs | ||
renumber.rs | ||
universal_regions.rs | ||
used_muts.rs |