@@ -53,7 +53,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
53
53
abi : Abi ,
54
54
link_name : Symbol ,
55
55
args : & [ OpTy < ' tcx , Provenance > ] ,
56
- unwind : StackPopUnwind ,
56
+ unwind : mir :: UnwindAction ,
57
57
) -> InterpResult < ' tcx > {
58
58
let this = self . eval_context_mut ( ) ;
59
59
@@ -106,7 +106,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
106
106
& [ data. into ( ) ] ,
107
107
None ,
108
108
// Directly return to caller.
109
- StackPopCleanup :: Goto { ret : Some ( ret) , unwind : StackPopUnwind :: Skip } ,
109
+ StackPopCleanup :: Goto { ret : Some ( ret) , unwind : mir :: UnwindAction :: Continue } ,
110
110
) ?;
111
111
112
112
// We ourselves will return `0`, eventually (will be overwritten if we catch a panic).
@@ -157,7 +157,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
157
157
& [ catch_unwind. data . into ( ) , payload. into ( ) ] ,
158
158
None ,
159
159
// Directly return to caller of `try`.
160
- StackPopCleanup :: Goto { ret : Some ( catch_unwind. ret ) , unwind : StackPopUnwind :: Skip } ,
160
+ StackPopCleanup :: Goto { ret : Some ( catch_unwind. ret ) , unwind : mir :: UnwindAction :: Continue } ,
161
161
) ?;
162
162
163
163
// We pushed a new stack frame, the engine should not do any jumping now!
@@ -168,7 +168,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
168
168
}
169
169
170
170
/// Start a panic in the interpreter with the given message as payload.
171
- fn start_panic ( & mut self , msg : & str , unwind : StackPopUnwind ) -> InterpResult < ' tcx > {
171
+ fn start_panic ( & mut self , msg : & str , unwind : mir :: UnwindAction ) -> InterpResult < ' tcx > {
172
172
let this = self . eval_context_mut ( ) ;
173
173
174
174
// First arg: message.
@@ -189,7 +189,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
189
189
fn assert_panic (
190
190
& mut self ,
191
191
msg : & mir:: AssertMessage < ' tcx > ,
192
- unwind : Option < mir:: BasicBlock > ,
192
+ unwind : mir:: UnwindAction ,
193
193
) -> InterpResult < ' tcx > {
194
194
use rustc_middle:: mir:: AssertKind :: * ;
195
195
let this = self . eval_context_mut ( ) ;
@@ -213,10 +213,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
213
213
None ,
214
214
StackPopCleanup :: Goto {
215
215
ret : None ,
216
- unwind : match unwind {
217
- Some ( cleanup) => StackPopUnwind :: Cleanup ( cleanup) ,
218
- None => StackPopUnwind :: Skip ,
219
- } ,
216
+ unwind,
220
217
} ,
221
218
) ?;
222
219
}
@@ -240,10 +237,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
240
237
None ,
241
238
StackPopCleanup :: Goto {
242
239
ret : None ,
243
- unwind : match unwind {
244
- Some ( cleanup) => StackPopUnwind :: Cleanup ( cleanup) ,
245
- None => StackPopUnwind :: Skip ,
246
- } ,
240
+ unwind,
247
241
} ,
248
242
) ?;
249
243
}
@@ -252,10 +246,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
252
246
// Forward everything else to `panic` lang item.
253
247
this. start_panic (
254
248
msg. description ( ) ,
255
- match unwind {
256
- Some ( cleanup) => StackPopUnwind :: Cleanup ( cleanup) ,
257
- None => StackPopUnwind :: Skip ,
258
- } ,
249
+ unwind,
259
250
) ?;
260
251
}
261
252
}
0 commit comments