Skip to main content

Module region_constraint

Module region_constraint 

Source
Expand description

The bulk of the logic for implementing -Zassumptions-on-binders

StructsΒ§

Assumptions
HigherRankedAliasMatcher πŸ”’
MaxUniverse πŸ”’
PlaceholderReplacer

EnumsΒ§

RegionConstraint

FunctionsΒ§

alias_outlives_candidates_from_assumptions πŸ”’
Converts an AliasTyOutlivesViaEnv constraint into an OR of region outlives constraints by matching the alias against any Alias: 'a assumptions. 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 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.
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 u into OR constraints involving regions from smaller universes with known relationships to the placeholder. For example:
regions_outlived_by
Returns all regions r2 for which r: r2 is known to hold in the universe associated with assumptions
regions_outlived_by_placeholder
Returns all regions r for which !t: r is known to hold in the universe associated with assumptions
regions_outliving
Returns all regions r2 for which r2: r is known to hold in the universe associated with assumptions
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.