Enum rustc_mir::interpret::UndefinedBehaviorInfo[−][src]

pub enum UndefinedBehaviorInfo<'tcx> {
Show variants Ub(String), Unreachable, BoundsCheckFailed { len: u64, index: u64, }, DivisionByZero, RemainderByZero, PointerArithOverflow, InvalidMeta(&'static str), InvalidDropFn(FnSig<'tcx>), UnterminatedCString(Pointer<()>), PointerUseAfterFree(AllocId), PointerOutOfBounds { ptr: Pointer<()>, msg: CheckInAllocMsg, allocation_size: Size, }, DanglingIntPointer(u64, CheckInAllocMsg), AlignmentCheckFailed { required: Align, has: Align, }, WriteToReadOnly(AllocId), DerefFunctionPointer(AllocId), ValidationFailure(String), InvalidBool(u8), InvalidChar(u32), InvalidTag(Scalar<()>), InvalidFunctionPointer(Pointer<()>), InvalidStr(Utf8Error), InvalidUninitBytes(Option<UninitBytesAccess>), DeadLocal, ScalarSizeMismatch { target_size: u64, data_size: u64, },
}
Expand description

Error information for when the program caused Undefined Behavior.

Variants

Ub(String)
Expand description

Free-form case. Only for errors that are never caught!

Unreachable
Expand description

Unreachable code was executed.

BoundsCheckFailed
Expand description

A slice/array index projection went out-of-bounds.

Show fields

Fields of BoundsCheckFailed

len: u64index: u64
DivisionByZero
Expand description

Something was divided by 0 (x / 0).

RemainderByZero
Expand description

Something was “remainded” by 0 (x % 0).

PointerArithOverflow
Expand description

Overflowing inbounds pointer arithmetic.

InvalidMeta(&'static str)
Expand description

Invalid metadata in a wide pointer (using str to avoid allocations).

InvalidDropFn(FnSig<'tcx>)
Expand description

Invalid drop function in vtable.

UnterminatedCString(Pointer<()>)
Expand description

Reading a C string that does not end within its allocation.

PointerUseAfterFree(AllocId)
Expand description

Dereferencing a dangling pointer after it got freed.

PointerOutOfBounds
Expand description

Used a pointer outside the bounds it is valid for.

Show fields

Fields of PointerOutOfBounds

ptr: Pointer<()>msg: CheckInAllocMsgallocation_size: Size
DanglingIntPointer(u64, CheckInAllocMsg)
Expand description

Using an integer as a pointer in the wrong way.

AlignmentCheckFailed
Expand description

Used a pointer with bad alignment.

Show fields

Fields of AlignmentCheckFailed

required: Alignhas: Align
WriteToReadOnly(AllocId)
Expand description

Writing to read-only memory.

DerefFunctionPointer(AllocId)
ValidationFailure(String)
Expand description

The value validity check found a problem. Should only be thrown by validity.rs and always point out which part of the value is the problem.

InvalidBool(u8)
Expand description

Using a non-boolean u8 as bool.

InvalidChar(u32)
Expand description

Using a non-character u32 as character.

InvalidTag(Scalar<()>)
Expand description

The tag of an enum does not encode an actual discriminant.

InvalidFunctionPointer(Pointer<()>)
Expand description

Using a pointer-not-to-a-function as function pointer.

InvalidStr(Utf8Error)
Expand description

Using a string that is not valid UTF-8,

InvalidUninitBytes(Option<UninitBytesAccess>)
Expand description

Using uninitialized data where it is not allowed.

DeadLocal
Expand description

Working with a local that is not currently live.

ScalarSizeMismatch
Expand description

Data size is not equal to target size.

Show fields

Fields of ScalarSizeMismatch

target_size: u64data_size: u64

Auto Trait Implementations

impl<'tcx> !RefUnwindSafe for UndefinedBehaviorInfo<'tcx>

impl<'tcx> !Send for UndefinedBehaviorInfo<'tcx>

impl<'tcx> !Sync for UndefinedBehaviorInfo<'tcx>

impl<'tcx> Unpin for UndefinedBehaviorInfo<'tcx>

impl<'tcx> !UnwindSafe for UndefinedBehaviorInfo<'tcx>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToString for T where
    T: Display + ?Sized, 
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> WithConstness for T[src]

fn with_constness(self, constness: Constness) -> ConstnessAnd<Self>[src]

fn with_const(self) -> ConstnessAnd<Self>[src]

fn without_const(self) -> ConstnessAnd<Self>[src]