Enum rustc_hir_typeck::cast::CastError
source · pub enum CastError {
Show 15 variants
ErrorGuaranteed(ErrorGuaranteed),
CastToBool,
CastToChar,
DifferingKinds,
SizedUnsizedCast,
IllegalCast,
NeedDeref,
NeedViaPtr,
NeedViaThinPtr,
NeedViaInt,
NonScalar,
UnknownExprPtrKind,
UnknownCastPtrKind,
IntToFatCast(Option<&'static str>),
ForeignNonExhaustiveAdt,
}
Variants§
ErrorGuaranteed(ErrorGuaranteed)
CastToBool
CastToChar
DifferingKinds
SizedUnsizedCast
Cast of thin to fat raw ptr (e.g., *const () as *const [u8]
).
IllegalCast
NeedDeref
NeedViaPtr
NeedViaThinPtr
NeedViaInt
NonScalar
UnknownExprPtrKind
UnknownCastPtrKind
IntToFatCast(Option<&'static str>)
Cast of int to (possibly) fat raw pointer.
Argument is the specific name of the metadata in plain words, such as “a vtable” or “a length”. If this argument is None, then the metadata is unknown, for example, when we’re typechecking a type parameter with a ?Sized bound.
ForeignNonExhaustiveAdt
Trait Implementations§
source§impl From<ErrorGuaranteed> for CastError
impl From<ErrorGuaranteed> for CastError
source§fn from(err: ErrorGuaranteed) -> Self
fn from(err: ErrorGuaranteed) -> Self
Converts to this type from the input type.
impl Copy for CastError
Auto Trait Implementations§
impl RefUnwindSafe for CastError
impl Send for CastError
impl Sync for CastError
impl Unpin for CastError
impl UnwindSafe for CastError
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
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: 24 bytes
Size for each variant:
ErrorGuaranteed
: 0 bytesCastToBool
: 0 bytesCastToChar
: 0 bytesDifferingKinds
: 0 bytesSizedUnsizedCast
: 0 bytesIllegalCast
: 0 bytesNeedDeref
: 0 bytesNeedViaPtr
: 0 bytesNeedViaThinPtr
: 0 bytesNeedViaInt
: 0 bytesNonScalar
: 0 bytesUnknownExprPtrKind
: 0 bytesUnknownCastPtrKind
: 0 bytesIntToFatCast
: 16 bytesForeignNonExhaustiveAdt
: 0 bytes