Skip to main content

Module region_constraint

Module region_constraint 

Source
Expand description

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

Structs§

And
An AND of leaf constraints. Always in “canonical form”, meaning:
Assumptions
HigherRankedAliasMatcher 🔒
Or
An OR of AND of LEAF constraints. Always in “canonical form” meaning:
PlaceholderReplacer
RegionConstraint
An And and an Or constraint both in canonical forms, with two additional constraints:

Enums§

LeafRegionConstraint

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:
propagate_ambiguity
Force the whole constraint to be ambiguous if it contains ambiguities which could have caused the constraint to be false if they had been false themselves.
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_alias_ty_outlives_constraints_in_universe_for_eager_placeholder_handling 🔒
rewrite_placeholder_ty_outlives_constraints_in_universe_for_eager_placeholder_handling 🔒
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.