Skip to content

Commit 8932aeb

Browse files
committed
remove unused error variant
1 parent 1f21ab1 commit 8932aeb

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

compiler/rustc_middle/src/mir/interpret/error.rs

-3
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,6 @@ pub enum UnsupportedOpInfo {
397397
//
398398
// The variants below are only reachable from CTFE/const prop, miri will never emit them.
399399
//
400-
/// Encountered raw bytes where we needed a pointer.
401-
ReadBytesAsPointer,
402400
/// Accessing thread local statics
403401
ThreadLocalStatic(DefId),
404402
/// Accessing an unsupported extern static.
@@ -413,7 +411,6 @@ impl fmt::Display for UnsupportedOpInfo {
413411
ReadExternStatic(did) => write!(f, "cannot read from extern static ({:?})", did),
414412
NoMirFor(did) => write!(f, "no MIR body is available for {:?}", did),
415413
ReadPointerAsBytes => write!(f, "unable to turn pointer into raw bytes",),
416-
ReadBytesAsPointer => write!(f, "unable to turn bytes into a pointer"),
417414
ThreadLocalStatic(did) => write!(f, "cannot access thread local static ({:?})", did),
418415
}
419416
}

compiler/rustc_mir/src/interpret/validity.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
335335
),
336336
self.path,
337337
err_ub!(DanglingIntPointer(..)) |
338-
err_ub!(PointerUseAfterFree(..)) |
339-
err_unsup!(ReadBytesAsPointer) =>
338+
err_ub!(PointerUseAfterFree(..)) =>
340339
{ "dangling vtable pointer in wide pointer" },
341340
err_ub!(AlignmentCheckFailed { .. }) =>
342341
{ "unaligned vtable pointer in wide pointer" },
@@ -347,8 +346,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
347346
self.ecx.read_drop_type_from_vtable(vtable),
348347
self.path,
349348
err_ub!(DanglingIntPointer(..)) |
350-
err_ub!(InvalidFunctionPointer(..)) |
351-
err_unsup!(ReadBytesAsPointer) =>
349+
err_ub!(InvalidFunctionPointer(..)) =>
352350
{ "invalid drop function pointer in vtable (not pointing to a function)" },
353351
err_ub!(InvalidVtableDropFn(..)) =>
354352
{ "invalid drop function pointer in vtable (function has incompatible signature)" },
@@ -437,8 +435,6 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
437435
{ "a dangling {} (address 0x{:x} is unallocated)", kind, i },
438436
err_ub!(PointerOutOfBounds { .. }) =>
439437
{ "a dangling {} (going beyond the bounds of its allocation)", kind },
440-
err_unsup!(ReadBytesAsPointer) =>
441-
{ "a dangling {} (created from integer)", kind },
442438
// This cannot happen during const-eval (because interning already detects
443439
// dangling pointers), but it can happen in Miri.
444440
err_ub!(PointerUseAfterFree(..)) =>
@@ -598,8 +594,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
598594
self.path,
599595
err_ub!(DanglingIntPointer(..)) |
600596
err_ub!(InvalidFunctionPointer(..)) |
601-
err_ub!(InvalidUninitBytes(None)) |
602-
err_unsup!(ReadBytesAsPointer) =>
597+
err_ub!(InvalidUninitBytes(None)) =>
603598
{ "{}", value } expected { "a function pointer" },
604599
);
605600
// FIXME: Check if the signature matches

0 commit comments

Comments
 (0)