pub fn postdom_upper_bound(&self, a: &T, b: &T) -> Option<&T> {
        let mut mubs = self.minimal_upper_bounds(a, b);
        loop {
            match mubs.len() {
                0 => return None,
                1 => return Some(mubs[0]),
                _ => {
                    let m = mubs.pop().unwrap();
                    let n = mubs.pop().unwrap();
                    mubs.extend(self.minimal_upper_bounds(n, m));
                }
            }
        }
    }
/// Picks what I am referring to as the "postdominating"
/// upper-bound for `a` and `b`. This is usually the least upper
/// bound, but in cases where there is no single least upper
/// bound, it is the "mutual immediate postdominator", if you
/// imagine a graph where `a < b` means `a -> b`.
///
/// This function is needed because region inference currently
/// requires that we produce a single "UB", and there is no best
/// choice for the LUB. Rather than pick arbitrarily, I pick a
/// less good, but predictable choice. This should help ensure
/// that region inference yields predictable results (though it
/// itself is not fully sufficient).
///
/// Examples are probably clearer than any prose I could write
/// (there are corresponding tests below, btw). In each case,
/// the query is `postdom_upper_bound(a, b)`:
///
/// ```text
/// // returns Some(x), which is also LUB
/// a -> a1 -> x
///            ^
///            |
/// b -> b1 ---+
///
/// // returns Some(x), which is not LUB (there is none)
/// // diagonal edges run left-to-right
/// a -> a1 -> x
///   \/       ^
///   /\       |
/// b -> b1 ---+
///
/// // returns None
/// a -> a1
/// b -> b1
/// ```
Picks what I am referring to as the "postdominating"
upper-bound for `a` and `b`. This is usually the least upper
bound, but in cases where there is no single least upper
bound, it is the "mutual immediate postdominator", if you
imagine a graph where `a < b` means `a -> b`.

This function is needed because region inference currently
requires that we produce a single "UB", and there is no best
choice for the LUB. Rather than pick arbitrarily, I pick a
less good, but predictable choice. This should help ensure
that region inference yields predictable results (though it
itself is not fully sufficient).

Examples are probably clearer than any prose I could write
(there are corresponding tests below, btw). In each case,
the query is `postdom_upper_bound(a, b)`.






Picks what I am referring to as the " postdominating " upper - bound for ` a ` and ` b ` . This is usually the least upper bound but in cases where there is no single least upper bound it is the " mutual immediate postdominator " if you imagine a graph where ` a < b ` means ` a - > b ` . This function is needed because region inference currently requires that we produce a single " UB " and there is no best choice for the LUB . Rather than pick arbitrarily I pick a less good but predictable choice . This should help ensure that region inference yields predictable results ( though it itself is not fully sufficient ) . Examples are probably clearer than any prose I could write ( there are corresponding tests below btw ) . In each case the query is ` postdom_upper_bound ( a b ) ` .
pub fn postdom_upper_bound(&self, a: &T, b: &T) -> Option<&T> {
        let mut mubs = self.minimal_upper_bounds(a, b);
        loop {
            match mubs.len() {
                0 => return None,
                1 => return Some(mubs[0]),
                _ => {
                    let m = mubs.pop().unwrap();
                    let n = mubs.pop().unwrap();
                    mubs.extend(self.minimal_upper_bounds(n, m));
                }
            }
        }
    }
pub fn postdom_upper_bound ( & self , a : & T , b : & T ) -> Option < & T > { let mut mubs = self . minimal_upper_bounds ( a , b ) ; loop { match mubs . len ( ) { 0 => return None , 1 => return Some ( mubs [ 0 ] ) , _ => { let m = mubs . pop ( ) . unwrap ( ) ; let n = mubs . pop ( ) . unwrap ( ) ; mubs . extend ( self . minimal_upper_bounds ( n , m ) ) ; } } } }
Picks what I am referring to as the "postdominating"
upper-bound for `a` and `b`.
Picks what I am referring to as the " postdominating " upper - bound for ` a ` and ` b ` .
&self
a
&T
b
&T