Structs§
- Bound
VarReplacer - Clause
With Supertrait Span - Elaborator
- “Elaboration” is the process of identifying all the predicates that
are implied by a source predicate. Currently, this basically means
walking the “supertraits” and other similar assumptions. For example,
if we know that
T: Ord
, the elaborator would deduce thatT: PartialOrd
holds as well. Similarly, if we havetrait Foo: 'static
, and we know thatT: Foo
, then we know thatT: 'static
. - Filter
ToTraits - A filter around an iterator of predicates that makes it yield up just trait references.
- Placeholder
Replacer - The inverse of
BoundVarReplacer
: replaces placeholders with the bound vars from which they came. - Predicate
Set
Enums§
Traits§
- Elaboratable
- Describes how to elaborate an obligation into a sub-obligation.
Functions§
- anonymize_
predicate - async_
iterator_ 🔒trait_ ref_ and_ outputs - closure_
trait_ 🔒ref_ and_ return_ type - coroutine_
trait_ 🔒ref_ and_ outputs - elaborate
- expand_
trait_ aliases - Return the trait and projection predicates that come from eagerly expanding the trait aliases in the list of clauses. For each trait predicate, record a stack of spans that trace from the user-written trait alias bound. For projection predicates, just record the span of the projection itself.
- future_
trait_ 🔒ref_ and_ outputs - impl_
item_ is_ final - iterator_
trait_ 🔒ref_ and_ outputs - sizedness_
fast_ path - supertrait_
def_ ids - Computes the def-ids of the transitive supertraits of
trait_def_id
. This (intentionally) does not compute the full elaborated super-predicates but just the set of def-ids. It is used to identify which traits may define a given associated type to help avoid cycle errors, and to make size estimates for vtable layout computation. - supertraits
- transitive_
bounds_ that_ define_ assoc_ item - A specialized variant of
elaborate
that only elaborates trait references that may define the given associated item with the nameassoc_name
. It uses theexplicit_supertraits_containing_assoc_item
query to avoid enumerating super-predicates that aren’t related toassoc_item
. This is used when resolving types likeSelf::Item
orT::Item
and helps to avoid cycle errors (see e.g. #35237). - upcast_
choices - Casts a trait reference into a reference to one of its super
traits; returns
None
iftarget_trait_def_id
is not a supertrait. - with_
replaced_ escaping_ bound_ vars - Executes
f
onvalue
after replacing all escaping bound variables with placeholders and then replaces these placeholders with the original bound variables in the result.