Skip to content

Commit aaa505a

Browse files
committed
remove some unused CTFE error variants
1 parent 02a4238 commit aaa505a

File tree

3 files changed

+1
-96
lines changed

3 files changed

+1
-96
lines changed

src/librustc/ich/impls_ty.rs

-42
Original file line numberDiff line numberDiff line change
@@ -597,48 +597,6 @@ for ::mir::interpret::EvalErrorKind<'gcx, O> {
597597
required.hash_stable(hcx, hasher);
598598
has.hash_stable(hcx, hasher)
599599
},
600-
MemoryLockViolation {
601-
ptr,
602-
len,
603-
frame,
604-
access,
605-
ref lock,
606-
} => {
607-
ptr.hash_stable(hcx, hasher);
608-
len.hash_stable(hcx, hasher);
609-
frame.hash_stable(hcx, hasher);
610-
access.hash_stable(hcx, hasher);
611-
lock.hash_stable(hcx, hasher)
612-
},
613-
MemoryAcquireConflict {
614-
ptr,
615-
len,
616-
kind,
617-
ref lock,
618-
} => {
619-
ptr.hash_stable(hcx, hasher);
620-
len.hash_stable(hcx, hasher);
621-
kind.hash_stable(hcx, hasher);
622-
lock.hash_stable(hcx, hasher)
623-
},
624-
InvalidMemoryLockRelease {
625-
ptr,
626-
len,
627-
frame,
628-
ref lock,
629-
} => {
630-
ptr.hash_stable(hcx, hasher);
631-
len.hash_stable(hcx, hasher);
632-
frame.hash_stable(hcx, hasher);
633-
lock.hash_stable(hcx, hasher)
634-
},
635-
DeallocatedLockedMemory {
636-
ptr,
637-
ref lock,
638-
} => {
639-
ptr.hash_stable(hcx, hasher);
640-
lock.hash_stable(hcx, hasher)
641-
},
642600
ValidationFailure(ref s) => s.hash_stable(hcx, hasher),
643601
TypeNotPrimitive(ty) => ty.hash_stable(hcx, hasher),
644602
ReallocatedWrongMemoryKind(ref a, ref b) => {

src/librustc/mir/interpret/error.rs

+1-50
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ use ty::{Ty, layout};
1515
use ty::layout::{Size, Align, LayoutError};
1616
use rustc_target::spec::abi::Abi;
1717

18-
use super::{
19-
Pointer, Lock, AccessKind
20-
};
18+
use super::Pointer;
2119

2220
use backtrace::Backtrace;
2321

@@ -274,29 +272,6 @@ pub enum EvalErrorKind<'tcx, O> {
274272
required: Align,
275273
has: Align,
276274
},
277-
MemoryLockViolation {
278-
ptr: Pointer,
279-
len: u64,
280-
frame: usize,
281-
access: AccessKind,
282-
lock: Lock,
283-
},
284-
MemoryAcquireConflict {
285-
ptr: Pointer,
286-
len: u64,
287-
kind: AccessKind,
288-
lock: Lock,
289-
},
290-
InvalidMemoryLockRelease {
291-
ptr: Pointer,
292-
len: u64,
293-
frame: usize,
294-
lock: Lock,
295-
},
296-
DeallocatedLockedMemory {
297-
ptr: Pointer,
298-
lock: Lock,
299-
},
300275
ValidationFailure(String),
301276
CalledClosureAsFunction,
302277
VtableForArgumentlessMethod,
@@ -360,16 +335,8 @@ impl<'tcx, O> EvalErrorKind<'tcx, O> {
360335
"pointer offset outside bounds of allocation",
361336
InvalidNullPointerUsage =>
362337
"invalid use of NULL pointer",
363-
MemoryLockViolation { .. } =>
364-
"memory access conflicts with lock",
365-
MemoryAcquireConflict { .. } =>
366-
"new memory lock conflicts with existing lock",
367338
ValidationFailure(..) =>
368339
"type validation failed",
369-
InvalidMemoryLockRelease { .. } =>
370-
"invalid attempt to release write lock",
371-
DeallocatedLockedMemory { .. } =>
372-
"tried to deallocate memory in conflict with a lock",
373340
ReadPointerAsBytes =>
374341
"a raw memory access tried to access part of a pointer value as raw bytes",
375342
ReadBytesAsPointer =>
@@ -495,22 +462,6 @@ impl<'tcx, O: fmt::Debug> fmt::Debug for EvalErrorKind<'tcx, O> {
495462
if access { "memory access" } else { "pointer computed" },
496463
ptr.offset.bytes(), ptr.alloc_id, allocation_size.bytes())
497464
},
498-
MemoryLockViolation { ptr, len, frame, access, ref lock } => {
499-
write!(f, "{:?} access by frame {} at {:?}, size {}, is in conflict with lock {:?}",
500-
access, frame, ptr, len, lock)
501-
}
502-
MemoryAcquireConflict { ptr, len, kind, ref lock } => {
503-
write!(f, "new {:?} lock at {:?}, size {}, is in conflict with lock {:?}",
504-
kind, ptr, len, lock)
505-
}
506-
InvalidMemoryLockRelease { ptr, len, frame, ref lock } => {
507-
write!(f, "frame {} tried to release memory write lock at {:?}, size {}, but \
508-
cannot release lock {:?}", frame, ptr, len, lock)
509-
}
510-
DeallocatedLockedMemory { ptr, ref lock } => {
511-
write!(f, "tried to deallocate memory at {:?} in conflict with lock {:?}",
512-
ptr, lock)
513-
}
514465
ValidationFailure(ref err) => {
515466
write!(f, "type validation failed: {}", err)
516467
}

src/librustc_mir/transform/const_prop.rs

-4
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,7 @@ impl<'a, 'mir, 'tcx> ConstPropagator<'a, 'mir, 'tcx> {
183183
| InvalidDiscriminant(..)
184184
| PointerOutOfBounds { .. }
185185
| InvalidNullPointerUsage
186-
| MemoryLockViolation { .. }
187-
| MemoryAcquireConflict { .. }
188186
| ValidationFailure(..)
189-
| InvalidMemoryLockRelease { .. }
190-
| DeallocatedLockedMemory { .. }
191187
| InvalidPointerMath
192188
| ReadUndefBytes(_)
193189
| DeadLocal

0 commit comments

Comments
 (0)