Skip to main content

compute_new_region_constraints

Function compute_new_region_constraints 

Source
fn compute_new_region_constraints<Infcx: InferCtxtLike<Interner = I>, I: Interner>(
    infcx: &Infcx,
    constraints: &[RegionConstraint<I>],
    u: UniverseIndex,
) -> Vec<RegionConstraint<I>>
Expand description

Filter our region constraints to not include constraints between region variables from u and other regions as those are always satisfied. This requires some care to handle correctly for example: '!a_u1: '?x_u1: '!b_u1 should result in us requiring '!a_u1: '!b_u1 rather than dropping the two constraints entirely.

The only constraints involving things from u should be region outlives constraints at this point. Type outlives constraints should have been handled already either by destructuring into region outlives or by being rewritten in terms of smaller universe variables.