diff --git a/src/librustc/infer/outlives/free_region_map.rs b/src/librustc/infer/outlives/free_region_map.rs index 36e0d6dba5e8..72db8622672f 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 933e08811ce5..2419edf5ddcc 100644 --- a/src/librustc_data_structures/transitive_relation.rs +++ b/src/librustc_data_structures/transitive_relation.rs @@ -134,12 +134,13 @@ impl TransitiveRelation { } } - /// 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`, 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()