Skip to content

Commit fb4b06a

Browse files
committed
rename greater_than to reachable_from
1 parent 45f6027 commit fb4b06a

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

src/librustc/infer/outlives/free_region_map.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,6 @@ impl<'tcx> FreeRegionMap<'tcx> {
7373
debug!("lub_free_regions(r_a={:?}, r_b={:?}) = {:?}", r_a, r_b, result);
7474
result
7575
}
76-
77-
/// Returns all regions that are known to outlive `r_a`. For
78-
/// example, in a function:
79-
///
80-
/// ```
81-
/// fn foo<'a, 'b: 'a, 'c: 'b>() { .. }
82-
/// ```
83-
///
84-
/// if `r_a` represents `'a`, this function would return `{'b, 'c}`.
85-
pub fn regions_that_outlive<'a, 'gcx>(&self, r_a: Region<'tcx>) -> Vec<&Region<'tcx>> {
86-
assert!(is_free(r_a) || *r_a == ty::ReStatic);
87-
self.relation.greater_than(&r_a)
88-
}
8976
}
9077

9178
fn is_free(r: Region) -> bool {

src/librustc_data_structures/transitive_relation.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,13 @@ impl<T: Clone + Debug + Eq + Hash + Clone> TransitiveRelation<T> {
134134
}
135135
}
136136

137-
/// Returns a vector of all things greater than `a`.
137+
/// Thinking of `x R y` as an edge `x -> y` in a graph, this
138+
/// returns all things reachable from `a`.
138139
///
139140
/// Really this probably ought to be `impl Iterator<Item=&T>`, but
140141
/// I'm too lazy to make that work, and -- given the caching
141142
/// strategy -- it'd be a touch tricky anyhow.
142-
pub fn greater_than(&self, a: &T) -> Vec<&T> {
143+
pub fn reachable_from(&self, a: &T) -> Vec<&T> {
143144
match self.index(a) {
144145
Some(a) => self.with_closure(|closure| {
145146
closure.iter(a.0).map(|i| &self.elements[i]).collect()

0 commit comments

Comments
 (0)