Module project

Source
Expand description

Code for projecting associated types out of trait references.

Structsยง

InProgress ๐Ÿ”’
Progress ๐Ÿ”’

Enumsยง

ProjectAndUnifyResult ๐Ÿ”’
States returned from poly_project_and_unify_type. Takes the place of the old return type, which was:
Projected ๐Ÿ”’
ProjectionCandidate ๐Ÿ”’
ProjectionCandidateSet ๐Ÿ”’
ProjectionError
When attempting to resolve <T as TraitRef>::Name โ€ฆ

Traitsยง

ProjectionCacheKeyExt ๐Ÿ”’

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 of Foo 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_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, but T: 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). Returns None 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:

Type Aliasesยง

PolyProjectionObligation
ProjectionObligation
ProjectionTermObligation