Expand description
Code for projecting associated types out of trait references.
Structs§
- InProgress 🔒
- Progress 🔒
Enums§
- Project
AndUnify 🔒Result - States returned from
poly_project_and_unify_type
. Takes the place of the old return type, which was: - Projected 🔒
- Projection
Candidate 🔒 - Projection
Candidate 🔒Set - Projection
Error - When attempting to resolve
<T as TraitRef>::Name
…
Traits§
Functions§
- assemble_
candidates_ 🔒from_ impls - assemble_
candidates_ 🔒from_ object_ ty - In the case of a trait object like
<dyn Iterator<Item = ()> as Iterator>::Item
we can use the existential predicate in the trait object. - assemble_
candidates_ 🔒from_ param_ env - The first thing we have to do is scan through the parameter environment to see whether there are any projection predicates there that can answer this question.
- assemble_
candidates_ 🔒from_ predicates - assemble_
candidates_ 🔒from_ trait_ def - In the case of a nested projection like
<<A as Foo>::FooT as Bar>::BarT
, we may find that the definition ofFoo
has some clues: - assoc_
ty_ 🔒own_ obligations - compute_
inherent_ assoc_ ty_ args - confirm_
async_ 🔒closure_ candidate - confirm_
async_ 🔒fn_ kind_ helper_ candidate - confirm_
async_ 🔒iterator_ candidate - confirm_
builtin_ 🔒candidate - confirm_
callable_ 🔒candidate - confirm_
candidate 🔒 - confirm_
closure_ 🔒candidate - confirm_
coroutine_ 🔒candidate - confirm_
fn_ 🔒pointer_ candidate - confirm_
future_ 🔒candidate - confirm_
impl_ 🔒candidate - confirm_
iterator_ 🔒candidate - confirm_
object_ 🔒rpitit_ candidate - confirm_
param_ 🔒env_ candidate - confirm_
select_ 🔒candidate - normalize_
inherent_ projection - Confirm and normalize the given inherent projection.
- normalize_
projection_ ty - The guts of
normalize
: normalize a specific projection like<T as Trait>::Item
. The result is always a type (and possibly additional obligations). If ambiguity arises, which implies that there are unresolved type variables in the projection, we will instantiate it with a fresh type variable$X
and generate a new obligation<T as Trait>::Item == $X
for later. - normalize_
to_ 🔒error - If we are projecting
<T as Trait>::Item
, butT: Trait
does not hold. In various error cases, we cannot generate a valid normalized projection. Therefore, we create an inference variable return an associated obligation that, when fulfilled, will lead to an error. - opt_
normalize_ 🔒projection_ term - The guts of
normalize
: normalize a specific projection like<T as Trait>::Item
. The result is always a type (and possibly additional obligations). ReturnsNone
in the case of ambiguity, which indicates that there are unbound type variables. - poly_
project_ 🔒and_ unify_ term - Evaluates constraints of the form:
- project 🔒
- Computes the result of a projection type (if we can).
- project_
and_ 🔒unify_ term - Evaluates constraints of the form: