Skip to content

Commit 97deff1

Browse files
committed
temporarily allow access to live regions at a given CFG point
1 parent b012615 commit 97deff1

File tree

1 file changed

+5
-0
lines changed
  • compiler/rustc_borrowck/src/region_infer

1 file changed

+5
-0
lines changed

compiler/rustc_borrowck/src/region_infer/values.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ impl<N: Idx> LivenessValues<N> {
176176
pub(crate) fn region_value_str(&self, r: N) -> String {
177177
region_value_str(self.get_elements(r).map(RegionElement::Location))
178178
}
179+
180+
pub(crate) fn live_regions_at(&self, location: Location) -> impl Iterator<Item = N> + '_ {
181+
let point = self.elements.point_from_location(location);
182+
self.points.rows().filter(move |row| self.points.contains(*row, point))
183+
}
179184
}
180185

181186
/// Maps from `ty::PlaceholderRegion` values that are used in the rest of

0 commit comments

Comments
 (0)