Enum rustc_typeck::check::cast::PointerKind
source · [−]enum PointerKind<'tcx> {
Thin,
VTable(Option<DefId>),
Length,
OfProjection(&'tcx ProjectionTy<'tcx>),
OfOpaque(DefId, SubstsRef<'tcx>),
OfParam(&'tcx ParamTy),
}
Expand description
The kind of pointer and associated metadata (thin, length or vtable) - we only allow casts between fat pointers if their metadata have the same kind.
Variants
Thin
No metadata attached, ie pointer to sized type or foreign type
VTable(Option<DefId>)
A trait object
Length
Slice
OfProjection(&'tcx ProjectionTy<'tcx>)
The unsize info of this projection
OfOpaque(DefId, SubstsRef<'tcx>)
The unsize info of this opaque ty
OfParam(&'tcx ParamTy)
The unsize info of this parameter
Trait Implementations
sourceimpl<'tcx> Clone for PointerKind<'tcx>
impl<'tcx> Clone for PointerKind<'tcx>
sourcefn clone(&self) -> PointerKind<'tcx>
fn clone(&self) -> PointerKind<'tcx>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<'tcx> PartialEq<PointerKind<'tcx>> for PointerKind<'tcx>
impl<'tcx> PartialEq<PointerKind<'tcx>> for PointerKind<'tcx>
sourcefn eq(&self, other: &PointerKind<'tcx>) -> bool
fn eq(&self, other: &PointerKind<'tcx>) -> bool
impl<'tcx> Copy for PointerKind<'tcx>
impl<'tcx> Eq for PointerKind<'tcx>
impl<'tcx> StructuralEq for PointerKind<'tcx>
impl<'tcx> StructuralPartialEq for PointerKind<'tcx>
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for PointerKind<'tcx>
impl<'tcx> Send for PointerKind<'tcx>
impl<'tcx> Sync for PointerKind<'tcx>
impl<'tcx> Unpin for PointerKind<'tcx>
impl<'tcx> !UnwindSafe for PointerKind<'tcx>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes
Size for each variant:
Thin
: 0 bytesVTable
: 8 bytesLength
: 0 bytesOfProjection
: 8 bytesOfOpaque
: 16 bytesOfParam
: 8 bytes