remove some unused CTFE error variants
This commit is contained in:
parent
02a42382f6
commit
aaa505af02
3 changed files with 1 additions and 96 deletions
|
@ -597,48 +597,6 @@ for ::mir::interpret::EvalErrorKind<'gcx, O> {
|
||||||
required.hash_stable(hcx, hasher);
|
required.hash_stable(hcx, hasher);
|
||||||
has.hash_stable(hcx, hasher)
|
has.hash_stable(hcx, hasher)
|
||||||
},
|
},
|
||||||
MemoryLockViolation {
|
|
||||||
ptr,
|
|
||||||
len,
|
|
||||||
frame,
|
|
||||||
access,
|
|
||||||
ref lock,
|
|
||||||
} => {
|
|
||||||
ptr.hash_stable(hcx, hasher);
|
|
||||||
len.hash_stable(hcx, hasher);
|
|
||||||
frame.hash_stable(hcx, hasher);
|
|
||||||
access.hash_stable(hcx, hasher);
|
|
||||||
lock.hash_stable(hcx, hasher)
|
|
||||||
},
|
|
||||||
MemoryAcquireConflict {
|
|
||||||
ptr,
|
|
||||||
len,
|
|
||||||
kind,
|
|
||||||
ref lock,
|
|
||||||
} => {
|
|
||||||
ptr.hash_stable(hcx, hasher);
|
|
||||||
len.hash_stable(hcx, hasher);
|
|
||||||
kind.hash_stable(hcx, hasher);
|
|
||||||
lock.hash_stable(hcx, hasher)
|
|
||||||
},
|
|
||||||
InvalidMemoryLockRelease {
|
|
||||||
ptr,
|
|
||||||
len,
|
|
||||||
frame,
|
|
||||||
ref lock,
|
|
||||||
} => {
|
|
||||||
ptr.hash_stable(hcx, hasher);
|
|
||||||
len.hash_stable(hcx, hasher);
|
|
||||||
frame.hash_stable(hcx, hasher);
|
|
||||||
lock.hash_stable(hcx, hasher)
|
|
||||||
},
|
|
||||||
DeallocatedLockedMemory {
|
|
||||||
ptr,
|
|
||||||
ref lock,
|
|
||||||
} => {
|
|
||||||
ptr.hash_stable(hcx, hasher);
|
|
||||||
lock.hash_stable(hcx, hasher)
|
|
||||||
},
|
|
||||||
ValidationFailure(ref s) => s.hash_stable(hcx, hasher),
|
ValidationFailure(ref s) => s.hash_stable(hcx, hasher),
|
||||||
TypeNotPrimitive(ty) => ty.hash_stable(hcx, hasher),
|
TypeNotPrimitive(ty) => ty.hash_stable(hcx, hasher),
|
||||||
ReallocatedWrongMemoryKind(ref a, ref b) => {
|
ReallocatedWrongMemoryKind(ref a, ref b) => {
|
||||||
|
|
|
@ -15,9 +15,7 @@ use ty::{Ty, layout};
|
||||||
use ty::layout::{Size, Align, LayoutError};
|
use ty::layout::{Size, Align, LayoutError};
|
||||||
use rustc_target::spec::abi::Abi;
|
use rustc_target::spec::abi::Abi;
|
||||||
|
|
||||||
use super::{
|
use super::Pointer;
|
||||||
Pointer, Lock, AccessKind
|
|
||||||
};
|
|
||||||
|
|
||||||
use backtrace::Backtrace;
|
use backtrace::Backtrace;
|
||||||
|
|
||||||
|
@ -274,29 +272,6 @@ pub enum EvalErrorKind<'tcx, O> {
|
||||||
required: Align,
|
required: Align,
|
||||||
has: Align,
|
has: Align,
|
||||||
},
|
},
|
||||||
MemoryLockViolation {
|
|
||||||
ptr: Pointer,
|
|
||||||
len: u64,
|
|
||||||
frame: usize,
|
|
||||||
access: AccessKind,
|
|
||||||
lock: Lock,
|
|
||||||
},
|
|
||||||
MemoryAcquireConflict {
|
|
||||||
ptr: Pointer,
|
|
||||||
len: u64,
|
|
||||||
kind: AccessKind,
|
|
||||||
lock: Lock,
|
|
||||||
},
|
|
||||||
InvalidMemoryLockRelease {
|
|
||||||
ptr: Pointer,
|
|
||||||
len: u64,
|
|
||||||
frame: usize,
|
|
||||||
lock: Lock,
|
|
||||||
},
|
|
||||||
DeallocatedLockedMemory {
|
|
||||||
ptr: Pointer,
|
|
||||||
lock: Lock,
|
|
||||||
},
|
|
||||||
ValidationFailure(String),
|
ValidationFailure(String),
|
||||||
CalledClosureAsFunction,
|
CalledClosureAsFunction,
|
||||||
VtableForArgumentlessMethod,
|
VtableForArgumentlessMethod,
|
||||||
|
@ -360,16 +335,8 @@ impl<'tcx, O> EvalErrorKind<'tcx, O> {
|
||||||
"pointer offset outside bounds of allocation",
|
"pointer offset outside bounds of allocation",
|
||||||
InvalidNullPointerUsage =>
|
InvalidNullPointerUsage =>
|
||||||
"invalid use of NULL pointer",
|
"invalid use of NULL pointer",
|
||||||
MemoryLockViolation { .. } =>
|
|
||||||
"memory access conflicts with lock",
|
|
||||||
MemoryAcquireConflict { .. } =>
|
|
||||||
"new memory lock conflicts with existing lock",
|
|
||||||
ValidationFailure(..) =>
|
ValidationFailure(..) =>
|
||||||
"type validation failed",
|
"type validation failed",
|
||||||
InvalidMemoryLockRelease { .. } =>
|
|
||||||
"invalid attempt to release write lock",
|
|
||||||
DeallocatedLockedMemory { .. } =>
|
|
||||||
"tried to deallocate memory in conflict with a lock",
|
|
||||||
ReadPointerAsBytes =>
|
ReadPointerAsBytes =>
|
||||||
"a raw memory access tried to access part of a pointer value as raw bytes",
|
"a raw memory access tried to access part of a pointer value as raw bytes",
|
||||||
ReadBytesAsPointer =>
|
ReadBytesAsPointer =>
|
||||||
|
@ -495,22 +462,6 @@ impl<'tcx, O: fmt::Debug> fmt::Debug for EvalErrorKind<'tcx, O> {
|
||||||
if access { "memory access" } else { "pointer computed" },
|
if access { "memory access" } else { "pointer computed" },
|
||||||
ptr.offset.bytes(), ptr.alloc_id, allocation_size.bytes())
|
ptr.offset.bytes(), ptr.alloc_id, allocation_size.bytes())
|
||||||
},
|
},
|
||||||
MemoryLockViolation { ptr, len, frame, access, ref lock } => {
|
|
||||||
write!(f, "{:?} access by frame {} at {:?}, size {}, is in conflict with lock {:?}",
|
|
||||||
access, frame, ptr, len, lock)
|
|
||||||
}
|
|
||||||
MemoryAcquireConflict { ptr, len, kind, ref lock } => {
|
|
||||||
write!(f, "new {:?} lock at {:?}, size {}, is in conflict with lock {:?}",
|
|
||||||
kind, ptr, len, lock)
|
|
||||||
}
|
|
||||||
InvalidMemoryLockRelease { ptr, len, frame, ref lock } => {
|
|
||||||
write!(f, "frame {} tried to release memory write lock at {:?}, size {}, but \
|
|
||||||
cannot release lock {:?}", frame, ptr, len, lock)
|
|
||||||
}
|
|
||||||
DeallocatedLockedMemory { ptr, ref lock } => {
|
|
||||||
write!(f, "tried to deallocate memory at {:?} in conflict with lock {:?}",
|
|
||||||
ptr, lock)
|
|
||||||
}
|
|
||||||
ValidationFailure(ref err) => {
|
ValidationFailure(ref err) => {
|
||||||
write!(f, "type validation failed: {}", err)
|
write!(f, "type validation failed: {}", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,11 +183,7 @@ impl<'a, 'mir, 'tcx> ConstPropagator<'a, 'mir, 'tcx> {
|
||||||
| InvalidDiscriminant(..)
|
| InvalidDiscriminant(..)
|
||||||
| PointerOutOfBounds { .. }
|
| PointerOutOfBounds { .. }
|
||||||
| InvalidNullPointerUsage
|
| InvalidNullPointerUsage
|
||||||
| MemoryLockViolation { .. }
|
|
||||||
| MemoryAcquireConflict { .. }
|
|
||||||
| ValidationFailure(..)
|
| ValidationFailure(..)
|
||||||
| InvalidMemoryLockRelease { .. }
|
|
||||||
| DeallocatedLockedMemory { .. }
|
|
||||||
| InvalidPointerMath
|
| InvalidPointerMath
|
||||||
| ReadUndefBytes(_)
|
| ReadUndefBytes(_)
|
||||||
| DeadLocal
|
| DeadLocal
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue