about summary refs log tree commit diff
path: root/compiler/rustc_middle
diff options
context:
space:
mode:
authorSmitty <me@smitop.com>2021-06-30 15:38:31 -0400
committerSmitty <me@smitop.com>2021-06-30 15:38:31 -0400
commit3e20129a18b34ba3aa13efaa53ddfa09dfb1fb7b (patch)
tree9783c788b4733dbde082c05fac0624ba14f10869 /compiler/rustc_middle
parent12a8d106f6a38f45ec01c1b7d3b2c4bfe62d741d (diff)
downloadrust-3e20129a18b34ba3aa13efaa53ddfa09dfb1fb7b.tar.gz
rust-3e20129a18b34ba3aa13efaa53ddfa09dfb1fb7b.zip
Delay ICE on evaluation fail
Diffstat (limited to 'compiler/rustc_middle')
-rw-r--r--compiler/rustc_middle/src/mir/interpret/allocation.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/mir/interpret/allocation.rs b/compiler/rustc_middle/src/mir/interpret/allocation.rs
index 273609c639c..49e0af9a3a4 100644
--- a/compiler/rustc_middle/src/mir/interpret/allocation.rs
+++ b/compiler/rustc_middle/src/mir/interpret/allocation.rs
@@ -8,6 +8,7 @@ use std::ptr;
 
 use rustc_ast::Mutability;
 use rustc_data_structures::sorted_map::SortedMap;
+use rustc_span::DUMMY_SP;
 use rustc_target::abi::{Align, HasDataLayout, Size};
 
 use super::{
@@ -15,6 +16,7 @@ use super::{
     ResourceExhaustionInfo, Scalar, ScalarMaybeUninit, UndefinedBehaviorInfo, UninitBytesAccess,
     UnsupportedOpInfo,
 };
+use crate::ty;
 
 /// This type represents an Allocation in the Miri/CTFE core engine.
 ///
@@ -132,6 +134,9 @@ impl<Tag> Allocation<Tag> {
             // deterministic. However, we can be non-determinstic here because all uses of const
             // evaluation (including ConstProp!) will make compilation fail (via hard error
             // or ICE) upon encountering a `MemoryExhausted` error.
+            ty::tls::with(|tcx| {
+                tcx.sess.delay_span_bug(DUMMY_SP, "exhausted memory during interpreation")
+            });
             InterpError::ResourceExhaustion(ResourceExhaustionInfo::MemoryExhausted)
         })?;
         bytes.resize(size.bytes_usize(), 0);