Re-exportsΒ§
use std::collections::VecDeque;πuse rustc_attr_ir::lang_items::LangItem;πuse rustc_data_structures::fx::FxHashSet;πuse rustc_hir::def_id::DefId;πuse rustc_infer::infer::InferCtxt;πuse rustc_middle::ty;πuse rustc_middle::ty::CallerBoundsIterator;πuse rustc_middle::ty::SizedTraitKind;πuse rustc_middle::ty::Ty;πuse rustc_middle::ty::TyCtxt;πuse rustc_middle::ty::TypeFoldable;πuse rustc_middle::ty::TypeVisitableExt;πuse rustc_middle::ty::Unnormalized;πuse rustc_span::Span;πuse smallvec::SmallVec;πuse smallvec::smallvec;πuse tracing::debug;π
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: PartialOrdholds 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Β§
- Tuple
Arguments πFlag
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
- elaborate_
outlives_ assumptions - 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 - implicit_
fast_ path - iterator_
trait_ πref_ and_ outputs - 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
elaboratethat only elaborates trait references that may define the given associated item with the nameassoc_name. It uses theexplicit_supertraits_containing_assoc_itemquery to avoid enumerating super-predicates that arenβt related toassoc_item. This is used when resolving types likeSelf::ItemorT::Itemand 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
Noneiftarget_trait_def_idis not a supertrait. - with_
replaced_ escaping_ bound_ vars - Executes
fonvalueafter replacing all escaping bound variables with placeholders and then replaces these placeholders with the original bound variables in the result.