]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir/src/const_eval/machine.rs
Auto merge of #83918 - workingjubilee:stable-rangefrom-pat, r=joshtriplett
[rust.git] / compiler / rustc_mir / src / const_eval / machine.rs
index ddc87084e9fd19cf075f68e9e2d818351e8ad544..279f414e7fef14667bfb4d6e08061ccb70cf2731 100644 (file)
@@ -201,6 +201,8 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
 
     type MemoryExtra = MemoryExtra;
 
+    const PANIC_ON_ALLOC_FAIL: bool = false; // will be raised as a proper error
+
     fn load_mir(
         ecx: &InterpCx<'mir, 'tcx, Self>,
         instance: ty::InstanceDef<'tcx>,
@@ -391,7 +393,7 @@ fn init_frame_extra(
         frame: Frame<'mir, 'tcx>,
     ) -> InterpResult<'tcx, Frame<'mir, 'tcx>> {
         // Enforce stack size limit. Add 1 because this is run before the new frame is pushed.
-        if !ecx.tcx.sess.recursion_limit().value_within_limit(ecx.stack().len() + 1) {
+        if !ecx.recursion_limit.value_within_limit(ecx.stack().len() + 1) {
             throw_exhaust!(StackFrameLimitReached)
         } else {
             Ok(frame)