@@ -72,8 +72,8 @@ pub struct Frame<'tcx, Prov: Provenance = CtfeProvenance, Extra = ()> {
7272 ////////////////////////////////////////////////////////////////////////////////
7373 // Return place and locals
7474 ////////////////////////////////////////////////////////////////////////////////
75- /// Work to perform when returning from this function.
76- return_to_block : StackPopCleanup ,
75+ /// Where to continue when returning from this function.
76+ return_cont : ReturnContinuation ,
7777
7878 /// The location where the result of the current stack frame should be written to,
7979 /// and its layout in the caller. This place is to be interpreted relative to the
@@ -106,19 +106,19 @@ pub struct Frame<'tcx, Prov: Provenance = CtfeProvenance, Extra = ()> {
106106 pub ( super ) loc : Either < mir:: Location , Span > ,
107107}
108108
109+ /// Where and how to continue when returning/unwinding from the current function.
109110#[ derive( Clone , Copy , Eq , PartialEq , Debug ) ] // Miri debug-prints these
110- pub enum StackPopCleanup {
111+ pub enum ReturnContinuation {
111112 /// Jump to the next block in the caller, or cause UB if None (that's a function
112- /// that may never return). Also store layout of return place so
113- /// we can validate it at that layout.
113+ /// that may never return).
114114 /// `ret` stores the block we jump to on a normal return, while `unwind`
115115 /// stores the block used for cleanup during unwinding.
116116 Goto { ret : Option < mir:: BasicBlock > , unwind : mir:: UnwindAction } ,
117- /// The root frame of the stack: nowhere else to jump to.
117+ /// The root frame of the stack: nowhere else to jump to, so we stop .
118118 /// `cleanup` says whether locals are deallocated. Static computation
119119 /// wants them leaked to intern what they need (and just throw away
120120 /// the entire `ecx` when it is done).
121- Root { cleanup : bool } ,
121+ Stop { cleanup : bool } ,
122122}
123123
124124/// Return type of [`InterpCx::pop_stack_frame_raw`].
@@ -127,8 +127,8 @@ pub struct StackPopInfo<'tcx, Prov: Provenance> {
127127 /// stack frame.
128128 pub return_action : ReturnAction ,
129129
130- /// [`return_to_block `](Frame::return_to_block ) of the popped stack frame.
131- pub return_to_block : StackPopCleanup ,
130+ /// [`return_cont `](Frame::return_cont ) of the popped stack frame.
131+ pub return_cont : ReturnContinuation ,
132132
133133 /// [`return_place`](Frame::return_place) of the popped stack frame.
134134 pub return_place : PlaceTy < ' tcx , Prov > ,
@@ -255,7 +255,7 @@ impl<'tcx, Prov: Provenance> Frame<'tcx, Prov> {
255255 Frame {
256256 body : self . body ,
257257 instance : self . instance ,
258- return_to_block : self . return_to_block ,
258+ return_cont : self . return_cont ,
259259 return_place : self . return_place ,
260260 locals : self . locals ,
261261 loc : self . loc ,
@@ -350,20 +350,20 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
350350 /// the arguments or local variables.
351351 ///
352352 /// The high-level version of this is `init_stack_frame`.
353- #[ instrument( skip( self , body, return_place, return_to_block ) , level = "debug" ) ]
353+ #[ instrument( skip( self , body, return_place, return_cont ) , level = "debug" ) ]
354354 pub ( crate ) fn push_stack_frame_raw (
355355 & mut self ,
356356 instance : ty:: Instance < ' tcx > ,
357357 body : & ' tcx mir:: Body < ' tcx > ,
358358 return_place : & PlaceTy < ' tcx , M :: Provenance > ,
359- return_to_block : StackPopCleanup ,
359+ return_cont : ReturnContinuation ,
360360 ) -> InterpResult < ' tcx > {
361361 trace ! ( "body: {:#?}" , body) ;
362362
363363 // We can push a `Root` frame if and only if the stack is empty.
364364 debug_assert_eq ! (
365365 self . stack( ) . is_empty( ) ,
366- matches!( return_to_block , StackPopCleanup :: Root { .. } )
366+ matches!( return_cont , ReturnContinuation :: Stop { .. } )
367367 ) ;
368368
369369 // First push a stack frame so we have access to `instantiate_from_current_frame` and other
@@ -373,7 +373,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
373373 let pre_frame = Frame {
374374 body,
375375 loc : Right ( body. span ) , // Span used for errors caused during preamble.
376- return_to_block ,
376+ return_cont ,
377377 return_place : return_place. clone ( ) ,
378378 locals,
379379 instance,
@@ -429,15 +429,15 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
429429 copy_ret_val ( self , & frame. return_place ) ?;
430430 }
431431
432- let return_to_block = frame. return_to_block ;
432+ let return_cont = frame. return_cont ;
433433 let return_place = frame. return_place . clone ( ) ;
434434
435435 // Cleanup: deallocate locals.
436436 // Usually we want to clean up (deallocate locals), but in a few rare cases we don't.
437437 // We do this while the frame is still on the stack, so errors point to the callee.
438- let cleanup = match return_to_block {
439- StackPopCleanup :: Goto { .. } => true ,
440- StackPopCleanup :: Root { cleanup, .. } => cleanup,
438+ let cleanup = match return_cont {
439+ ReturnContinuation :: Goto { .. } => true ,
440+ ReturnContinuation :: Stop { cleanup, .. } => cleanup,
441441 } ;
442442
443443 let return_action = if cleanup {
@@ -455,7 +455,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
455455 ReturnAction :: NoCleanup
456456 } ;
457457
458- interp_ok ( StackPopInfo { return_action, return_to_block , return_place } )
458+ interp_ok ( StackPopInfo { return_action, return_cont , return_place } )
459459 }
460460
461461 /// In the current stack frame, mark all locals as live that are not arguments and don't have
0 commit comments