]> git.lizzy.rs Git - rust.git/commitdiff
UniversalRegionRelations: add a way to list the base non-transitive `outlives` constr...
authorRemy Rakic <remy.rakic@gmail.com>
Tue, 19 Nov 2019 15:55:58 +0000 (16:55 +0100)
committerRemy Rakic <remy.rakic@gmail.com>
Fri, 6 Dec 2019 10:50:01 +0000 (11:50 +0100)
src/librustc_mir/borrow_check/nll/type_check/free_region_relations.rs

index d18a8e87453a54e6788fc9eec352390b0588fa6e..8bb68383a49baa3da6d18db7ae1bb495336b3af8 100644 (file)
@@ -217,6 +217,11 @@ fn non_local_bounds<'a>(
     crate fn regions_outlived_by(&self, fr1: RegionVid) -> Vec<&RegionVid> {
         self.outlives.reachable_from(&fr1)
     }
+
+    /// Returns the _non-transitive_ set of known `outlives` constraints between free regions.
+    crate fn known_outlives(&self) -> impl Iterator<Item=(&RegionVid, &RegionVid)> {
+        self.outlives.base_edges()
+    }
 }
 
 struct UniversalRegionRelationsBuilder<'this, 'tcx> {