about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret/eval_context.rs
diff options
context:
space:
mode:
authorMaybe Lapkin <waffle.lapkin@gmail.com>2024-07-07 17:01:28 +0200
committerMaybe Lapkin <waffle.lapkin@gmail.com>2024-07-07 18:16:38 +0200
commit54e11cf378d5f3a423d98b9a8bcbc6c25078995a (patch)
tree7419a3b5255397cc892383b0136b52b79a0e0515 /compiler/rustc_const_eval/src/interpret/eval_context.rs
parentdd5a447b5abaabcefd1b8e6e03470aa345226e1e (diff)
downloadrust-54e11cf378d5f3a423d98b9a8bcbc6c25078995a.tar.gz
rust-54e11cf378d5f3a423d98b9a8bcbc6c25078995a.zip
add an assertion that machine hook doesn't return NoCleanup
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/eval_context.rs')
-rw-r--r--compiler/rustc_const_eval/src/interpret/eval_context.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/eval_context.rs b/compiler/rustc_const_eval/src/interpret/eval_context.rs
index 23ade4b0106..6d3e5ea1031 100644
--- a/compiler/rustc_const_eval/src/interpret/eval_context.rs
+++ b/compiler/rustc_const_eval/src/interpret/eval_context.rs
@@ -899,10 +899,12 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
         let return_to_block = frame.return_to_block;
         let return_place = frame.return_place.clone();
 
-        let return_action = if cleanup {
-            M::after_stack_pop(self, frame, unwinding)?
+        let return_action;
+        if cleanup {
+            return_action = M::after_stack_pop(self, frame, unwinding)?;
+            assert_ne!(return_action, ReturnAction::NoCleanup);
         } else {
-            ReturnAction::NoCleanup
+            return_action = ReturnAction::NoCleanup;
         };
 
         Ok(StackPopInfo { return_action, return_to_block, return_place })