about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2017-11-20 05:15:06 -0500
committerNiko Matsakis <niko@alum.mit.edu>2017-12-04 08:51:13 -0500
commitfb4b06ab3b6ef6f621bd937c548168bddb9d442e (patch)
treebf4f88bc23e04405de0416841eff3842e7ce3d05
parent45f60271960c7a56a7d455366ec41a1e423d61a2 (diff)
rename `greater_than` to `reachable_from`
-rw-r--r--src/librustc/infer/outlives/free_region_map.rs13
-rw-r--r--src/librustc_data_structures/transitive_relation.rs5
2 files changed, 3 insertions, 15 deletions
diff --git a/src/librustc/infer/outlives/free_region_map.rs b/src/librustc/infer/outlives/free_region_map.rs
index 36e0d6dba5e..72db8622672 100644
--- a/src/librustc/infer/outlives/free_region_map.rs
+++ b/src/librustc/infer/outlives/free_region_map.rs
@@ -73,19 +73,6 @@ impl<'tcx> FreeRegionMap<'tcx> {
         debug!("lub_free_regions(r_a={:?}, r_b={:?}) = {:?}", r_a, r_b, result);
         result
     }
-
-    /// Returns all regions that are known to outlive `r_a`. For
-    /// example, in a function:
-    ///
-    /// ```
-    /// fn foo<'a, 'b: 'a, 'c: 'b>() { .. }
-    /// ```
-    ///
-    /// if `r_a` represents `'a`, this function would return `{'b, 'c}`.
-    pub fn regions_that_outlive<'a, 'gcx>(&self, r_a: Region<'tcx>) -> Vec<&Region<'tcx>> {
-        assert!(is_free(r_a) || *r_a == ty::ReStatic);
-        self.relation.greater_than(&r_a)
-    }
 }
 
 fn is_free(r: Region) -> bool {
diff --git a/src/librustc_data_structures/transitive_relation.rs b/src/librustc_data_structures/transitive_relation.rs
index 933e08811ce..2419edf5ddc 100644
--- a/src/librustc_data_structures/transitive_relation.rs
+++ b/src/librustc_data_structures/transitive_relation.rs
@@ -134,12 +134,13 @@ impl<T: Clone + Debug + Eq + Hash + Clone> TransitiveRelation<T> {
         }
     }
 
-    /// Returns a vector of all things greater than `a`.
+    /// Thinking of `x R y` as an edge `x -> y` in a graph, this
+    /// returns all things reachable from `a`.
     ///
     /// Really this probably ought to be `impl Iterator<Item=&T>`, but
     /// I'm too lazy to make that work, and -- given the caching
     /// strategy -- it'd be a touch tricky anyhow.
-    pub fn greater_than(&self, a: &T) -> Vec<&T> {
+    pub fn reachable_from(&self, a: &T) -> Vec<&T> {
         match self.index(a) {
             Some(a) => self.with_closure(|closure| {
                 closure.iter(a.0).map(|i| &self.elements[i]).collect()