Enum rustc_middle::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!
Expand description
Unreachable code was executed.
Expand description
A slice/array index projection went out-of-bounds.
Expand description
Something was divided by 0 (x / 0).
Expand description
Something was “remainded” by 0 (x % 0).
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.
Expand description
Used a pointer outside the bounds it is valid for.
Show fields
Fields of PointerOutOfBounds
DanglingIntPointer(u64, CheckInAllocMsg)Expand description
Using an integer as a pointer in the wrong way.
Expand description
Used a pointer with bad alignment.
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.
Expand description
Working with a local that is not currently live.
Expand description
Data size is not equal to target size.
Trait Implementations
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> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> MaybeResult<T> for T[src]
impl<T> MaybeResult<T> for T[src]impl<T> WithConstness for T[src]
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]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,