Skip to main content

rewrite_type_outlives_constraints_in_universe_for_eager_placeholder_handling

Function rewrite_type_outlives_constraints_in_universe_for_eager_placeholder_handling 

Source
fn rewrite_type_outlives_constraints_in_universe_for_eager_placeholder_handling<Infcx: InferCtxtLike<Interner = I>, I: Interner>(
    infcx: &Infcx,
    constraint: RegionConstraint<I>,
    u: UniverseIndex,
    assumptions: &Option<Assumptions<I>>,
) -> RegionConstraint<I>
Expand description

Converts type outlives constraints into either region outlives constraints, or type outlives constraints which do not contain anything from u.

This only works off assumptions associated with the binder corresponding to u both for perf reasons and because the full set of region assumptions is not known during type checking due to closure signature inference.

This only really causes problems for higher-ranked outlives assumptions, for example if we have where for<'a> <T as Trait<'a>>::Assoc: 'b then we can’t use that to prove <T as Trait<'!c>>::Assoc: 'b until we are in the root context. See comments inside this function for more detail.