pub struct VirtualTraitImpl<'tcx> {
pub trait_pred: TraitPredicate<'tcx>,
pub implied_trait_proofs: Vec<TraitProof<'tcx>>,
pub types: Vec<(Ty<'tcx>, Vec<TraitProof<'tcx>>)>,
pub methods: Vec<VirtualTraitMethod<'tcx>>,
owner: DefId,
trait_ref: TraitRef<'tcx>,
dyn_data: OnceCell<Option<(Ty<'tcx>, Vec<PolyFnSig<'tcx>>)>>,
}Expand description
Partial data for a trait impl, used for fake trait impls that we generate ourselves such as
FnOnce and Drop impls.
Fields§
§trait_pred: TraitPredicate<'tcx>The trait that is implemented by this impl block.
implied_trait_proofs: Vec<TraitProof<'tcx>>The trait proofs required to satisfy the predicates on the trait declaration.
types: Vec<(Ty<'tcx>, Vec<TraitProof<'tcx>>)>The associated types and their predicates, in definition order.
methods: Vec<VirtualTraitMethod<'tcx>>The methods, in definition order.
owner: DefIdThe item under which this impl was built.
trait_ref: TraitRef<'tcx>The trait ref of the implemented trait, for dyn_data.
dyn_data: OnceCell<Option<(Ty<'tcx>, Vec<PolyFnSig<'tcx>>)>>Computed on demand, see VirtualTraitImpl::dyn_self.
Implementations§
Source§impl<'tcx> VirtualTraitImpl<'tcx>
impl<'tcx> VirtualTraitImpl<'tcx>
Sourcefn dyn_data(
&self,
s: &impl BaseState<'tcx>,
) -> Option<&(Ty<'tcx>, Vec<PolyFnSig<'tcx>>)>
fn dyn_data( &self, s: &impl BaseState<'tcx>, ) -> Option<&(Ty<'tcx>, Vec<PolyFnSig<'tcx>>)>
The dyn Trait<..> type for the implemented trait ref and the vtable signatures of the
methods (in definition order), if the trait is dyn-compatible. This is only needed for
vtables so we compute it on demand.
Trait Implementations§
Source§impl<'tcx> Clone for VirtualTraitImpl<'tcx>
impl<'tcx> Clone for VirtualTraitImpl<'tcx>
Source§fn clone(&self) -> VirtualTraitImpl<'tcx>
fn clone(&self) -> VirtualTraitImpl<'tcx>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'tcx> !DynSync for VirtualTraitImpl<'tcx>
impl<'tcx> !Freeze for VirtualTraitImpl<'tcx>
impl<'tcx> !RefUnwindSafe for VirtualTraitImpl<'tcx>
impl<'tcx> !Sync for VirtualTraitImpl<'tcx>
impl<'tcx> !UnwindSafe for VirtualTraitImpl<'tcx>
impl<'tcx> DynSend for VirtualTraitImpl<'tcx>
impl<'tcx> Send for VirtualTraitImpl<'tcx>
impl<'tcx> Unpin for VirtualTraitImpl<'tcx>
impl<'tcx> UnsafeUnpin for VirtualTraitImpl<'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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> ⓘ
Converts
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> ⓘ
Converts
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