Module rustc_trait_selection::solve::alias_relate
source · Expand description
Implements the AliasRelate
goal, which is used when unifying aliases.
Doing this via a separate goal is called “deferred alias relation” and part
of our more general approach to “lazy normalization”.
This goal, e.g. A alias-relate B
, may be satisfied by one of three branches:
- normalizes-to: If
A
is a projection, we can prove the equivalent projection predicate with B as the right-hand side of the projection. This goal is computed in both directions, if both are aliases. - subst-relate: Equate
A
andB
by their substs, if they’re both aliases with the same def-id. - bidirectional-normalizes-to: If
A
andB
are both projections, and both may apply, then we can compute the “intersection” of both normalizes-to by performing them together. This is used specifically to resolve ambiguities.
Enums
- Invert 🔒We may need to invert the alias relation direction if dealing an alias on the RHS.