“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 that T: PartialOrd
holds as well. Similarly, if we have trait Foo: 'static, and we know that
T: Foo, then we know that T: 'static.
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.
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.
A specialized variant of elaborate that only elaborates trait references that may
define the given associated item with the name assoc_name. It uses the
explicit_supertraits_containing_assoc_item query to avoid enumerating super-predicates that
aren’t related to assoc_item. This is used when resolving types like Self::Item or
T::Item and helps to avoid cycle errors (see e.g. #35237).
Executes f on value after replacing all escaping bound variables with placeholders
and then replaces these placeholders with the original bound variables in the result.