about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret
diff options
context:
space:
mode:
authorDrMeepster <19316085+DrMeepster@users.noreply.github.com>2022-05-19 17:33:12 -0700
committerDrMeepster <19316085+DrMeepster@users.noreply.github.com>2022-06-15 18:39:23 -0700
commitdff1f9f6bbb4a6a9c86da8d81695fec37054b0fb (patch)
tree4ebce837b4c78e02ffa9ebc8d88806b353511435 /compiler/rustc_const_eval/src/interpret
parent1d1ff362143facf95e91cb98cbe4957c6165bc11 (diff)
downloadrust-dff1f9f6bbb4a6a9c86da8d81695fec37054b0fb.tar.gz
rust-dff1f9f6bbb4a6a9c86da8d81695fec37054b0fb.zip
make sure miri ices when dereferencing a box
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret')
-rw-r--r--compiler/rustc_const_eval/src/interpret/place.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/place.rs b/compiler/rustc_const_eval/src/interpret/place.rs
index ae7180b674f..3dbcba72baf 100644
--- a/compiler/rustc_const_eval/src/interpret/place.rs
+++ b/compiler/rustc_const_eval/src/interpret/place.rs
@@ -313,6 +313,11 @@ where
     ) -> InterpResult<'tcx, MPlaceTy<'tcx, M::PointerTag>> {
         let val = self.read_immediate(src)?;
         trace!("deref to {} on {:?}", val.layout.ty, *val);
+
+        if val.layout.ty.is_box() {
+            bug!("dereferencing {:?}", val.layout.ty);
+        }
+
         let mplace = self.ref_to_mplace(&val)?;
         self.check_mplace_access(mplace, CheckInAllocMsg::DerefTest)?;
         Ok(mplace)