pub enum TraitProofKind<'tcx> {
Concrete(ItemRef<'tcx>),
LocalBound(GenericPredicateId),
SelfProof,
Dyn(DynBinder<'tcx, TraitProof<'tcx>>),
Builtin {
trait_data: BuiltinTraitData<'tcx>,
proofs: Vec<TraitProof<'tcx>>,
types: Vec<(DefId, Ty<'tcx>, Vec<TraitProof<'tcx>>)>,
},
Derived {
base: TraitProof<'tcx>,
path: TraitProofImpliedPredicate<'tcx>,
},
Error(String),
}Expand description
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.
Variants§
Concrete(ItemRef<'tcx>)
A concrete impl Trait for Type {} item.
LocalBound(GenericPredicateId)
A context-bound clause like where T: Trait.
SelfProof
The implicit Self: Trait clause present inside a trait Trait {} item.
Dyn(DynBinder<'tcx, TraitProof<'tcx>>)
dyn Trait is a wrapped value with a virtual table for trait
Trait. In other words, a value dyn Trait is a dependent
triple that gathers a type τ, a value of type τ and an
instance of type Trait.
dyn Trait implements Trait using a built-in implementation; this refers to that
built-in implementation.
The proof describes how to prove the current predicate in the context of the dyn Trait
self type, e.g. for <dyn Trait as Supertrait>.
Builtin
A built-in trait whose implementation is computed by the compiler, such as FnMut. This
morally points to an invisible impl block; as such it contains the information we may
need from one.
Fields
trait_data: BuiltinTraitData<'tcx>Extra data for the given trait.
proofs: Vec<TraitProof<'tcx>>The trait proofs required to satisfy the implied predicates on the trait declaration.
E.g. since FnMut: FnOnce, a built-in T: FnMut impl would have a proof for
T: FnOnce.
Derived
A predicate implied by base by following path.
Error(String)
An error happened while resolving traits.
Implementations§
Trait Implementations§
Source§impl<'tcx> Clone for TraitProofKind<'tcx>
impl<'tcx> Clone for TraitProofKind<'tcx>
Source§fn clone(&self) -> TraitProofKind<'tcx>
fn clone(&self) -> TraitProofKind<'tcx>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'tcx> Debug for TraitProofKind<'tcx>
impl<'tcx> Debug for TraitProofKind<'tcx>
impl<'tcx> Eq for TraitProofKind<'tcx>
Source§impl<'tcx> Hash for TraitProofKind<'tcx>
impl<'tcx> Hash for TraitProofKind<'tcx>
Source§impl<'tcx> PartialEq for TraitProofKind<'tcx>
impl<'tcx> PartialEq for TraitProofKind<'tcx>
Source§impl<'tcx, S: UnderOwnerState<'tcx>> SInto<S, TraitProofKind<'tcx>> for TraitProofKind<'tcx, DefId>
impl<'tcx, S: UnderOwnerState<'tcx>> SInto<S, TraitProofKind<'tcx>> for TraitProofKind<'tcx, DefId>
fn sinto(&self, s: &S) -> TraitProofKind<'tcx>
impl<'tcx> StructuralPartialEq for TraitProofKind<'tcx>
Auto Trait Implementations§
impl<'tcx> DynSend for TraitProofKind<'tcx>
impl<'tcx> DynSync for TraitProofKind<'tcx>
impl<'tcx> Freeze for TraitProofKind<'tcx>
impl<'tcx> RefUnwindSafe for TraitProofKind<'tcx>
impl<'tcx> Send for TraitProofKind<'tcx>
impl<'tcx> Sync for TraitProofKind<'tcx>
impl<'tcx> Unpin for TraitProofKind<'tcx>
impl<'tcx> UnsafeUnpin for TraitProofKind<'tcx>
impl<'tcx> UnwindSafe for TraitProofKind<'tcx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Dedup for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> HashConsable for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more