Expand description
The bulk of the logic for implementing -Zassumptions-on-binders
StructsΒ§
EnumsΒ§
FunctionsΒ§
- alias_
outlives_ πcandidates_ from_ assumptions - Converts an
AliasTyOutlivesViaEnvconstraint into an OR of region outlives constraints by matching the alias against anyAlias: 'aassumptions. This is somewhat tricky as we have a potentially higher ranked alias being equated with a potentially higher ranked assumption and we donβt handle it correctly right now (though it is a somewhat reasonable halfway step). - compute_
new_ πregion_ constraints - Filter our region constraints to not include constraints between region variables from
uand other regions as those are always satisfied. This requires some care to handle correctly for example:'!a_u1: '?x_u1: '!b_u1should result in us requiring'!a_u1: '!b_u1rather than dropping the two constraints entirely. - destructure_
type_ outlives_ constraints_ in_ root - Converts type outlives constraints into region outlives constraints. This assumes the complete set of assumptions are known. This should not be called until the end of type checking.
- eagerly_
handle_ placeholders_ in_ universe - Takes any constraints involving placeholders from the current universe and eagerly checks them. This can be done a few ways:
- evaluate_
solver_ constraint - Evaluate ANDs and ORs to true/false/ambiguous based on whether their arguments are true/false/ambiguous
- max_
universe - The largest universe a variable or placeholder was from in
t - pull_
region_ πoutlives_ constraints_ out_ of_ universe - Handles converting region outlives constraints involving placeholders from
uinto OR constraints involving regions from smaller universes with known relationships to the placeholder. For example: - regions_
outlived_ by - Returns all regions
r2for whichr: r2is known to hold in the universe associated withassumptions - regions_
outlived_ by_ placeholder - Returns all regions
rfor which!t: ris known to hold in the universe associated withassumptions - regions_
outliving - Returns all regions
r2for whichr2: ris known to hold in the universe associated withassumptions - rewrite_
type_ πoutlives_ constraints_ in_ universe_ for_ eager_ placeholder_ handling - Converts type outlives constraints into either region outlives constraints, or type outlives
constraints which do not contain anything from
u.