Function rustc::middle::typeck::infer::lattice::lattice_vars[src]
pub fn lattice_vars<L: LatticeDir + Combine, T: LatticeValue, K: UnifyKey<Bounds<T>>>(this: &L, a_vid: K, b_vid: K, lattice_dir_op: LatticeDirOp<T>) -> cres<LatticeVarResult<K, T>>
Computes the LUB or GLB of two bounded variables. These could be any sort of variables, but in the comments on this function I'll assume we are doing an LUB on two type variables.
This computation can be done in one of two ways:
If both variables have an upper bound, we may just compute the LUB of those bounds and return that, in which case we are returning a type. This is indicated with a
ValueResultreturn.If the variables do not both have an upper bound, we will unify the variables and return the unified variable, in which case the result is a variable. This is indicated with a
VarResultreturn.