Skip to main content

Module traits

Module traits 

Source

Re-exports§

pub use rustc_trait_elaboration as elaboration;

Structs§

ElaborationCtx
ItemPredicate
ItemPredicates
TraitProofContents

Enums§

AssocItemResolution
BuiltinTraitData
DestructData
ItemPredicateId
Uniquely identifies a predicate.
PredicateDirection
TraitProofImpliedPredicate
TraitProofKind
The source of a particular trait implementation. Most often this is either Concrete for a concrete impl Trait for Type {} item, or LocalBound for a context-bound where T: Trait.

Traits§

ItemId
The identifier of an item; generalizes over rustc’s DefId to allow for virtual items.
ToPolyTraitRef

Functions§

erase_and_norm
erase_free_regions
Erase free regions from the given value. Largely copied from tcx.erase_and_anonymize_regions, but also erases bound regions that are bound outside value, so we can call this function inside a Binder.
normalize
Normalize a value.
self_clause_for_item
Retrieve the Self: Trait clause for a trait associated item.
self_predicate
The special “self” predicate on a trait.
solve_destruct
Solve the T: Destruct predicate.
solve_item_implied_traits
Solve the trait obligations for implementing a trait (or for trait associated type bounds) in the current context.
solve_item_traits_inner 🔒
Apply the given generics to the provided clauses and resolve the trait references in the current context.
solve_sized
Solve the T: Sized predicate.
solve_trait
This is the entrypoint of the solving.
super_clause_to_clause_and_trait_proof
Given a clause clause in the context of some impl block impl_did, susbts correctly Self from clause and (1) derive a Clause and (2) resolve a TraitProof.
translate_item_ref
Translate a reference to an item, resolving the appropriate trait clauses as needed.

Type Aliases§

PredicateSearcher
TraitProof
A TraitProof describes the full data of a trait implementation. Because of generics, this may need to combine several concrete trait implementation items. For example, ((1u8, 2u8), "hello").clone() combines the generic implementation of Clone for (A, B) with the concrete implementations for u8 and &str, represented as a tree.