@@ -287,31 +287,33 @@ macro_rules! define {
287
287
}
288
288
289
289
// Unwind actions
290
+ pub struct UnwindActionArg ;
290
291
define ! (
291
292
"mir_unwind_continue" ,
292
293
/// An unwind action that continues unwinding.
293
- fn UnwindContinue ( )
294
+ fn UnwindContinue ( ) -> UnwindActionArg
294
295
) ;
295
296
define ! (
296
297
"mir_unwind_unreachable" ,
297
298
/// An unwind action that triggers undefined behaviour.
298
- fn UnwindUnreachable ( )
299
+ fn UnwindUnreachable ( ) -> UnwindActionArg
299
300
) ;
300
301
define ! (
301
302
"mir_unwind_terminate" ,
302
303
/// An unwind action that terminates the execution.
303
304
///
304
305
/// `UnwindTerminate` can also be used as a terminator.
305
- fn UnwindTerminate ( reason: UnwindTerminateReason )
306
+ fn UnwindTerminate ( reason: UnwindTerminateReason ) -> UnwindActionArg
306
307
) ;
307
308
define ! (
308
309
"mir_unwind_cleanup" ,
309
310
/// An unwind action that continues execution in a given basic blok.
310
- fn UnwindCleanup ( goto: BasicBlock )
311
+ fn UnwindCleanup ( goto: BasicBlock ) -> UnwindActionArg
311
312
) ;
312
313
313
314
// Return destination for `Call`
314
- define ! ( "mir_return_to" , fn ReturnTo ( goto: BasicBlock ) ) ;
315
+ pub struct ReturnToArg ;
316
+ define ! ( "mir_return_to" , fn ReturnTo ( goto: BasicBlock ) -> ReturnToArg ) ;
315
317
316
318
// Terminators
317
319
define ! ( "mir_return" , fn Return ( ) -> BasicBlock ) ;
@@ -330,7 +332,7 @@ define!("mir_drop",
330
332
/// - [`UnwindUnreachable`]
331
333
/// - [`UnwindTerminate`]
332
334
/// - [`UnwindCleanup`]
333
- fn Drop <T >( place: T , goto: ( ) , unwind_action: ( ) )
335
+ fn Drop <T >( place: T , goto: ReturnToArg , unwind_action: UnwindActionArg )
334
336
) ;
335
337
define ! ( "mir_call" ,
336
338
/// Call a function.
@@ -345,7 +347,7 @@ define!("mir_call",
345
347
/// - [`UnwindUnreachable`]
346
348
/// - [`UnwindTerminate`]
347
349
/// - [`UnwindCleanup`]
348
- fn Call ( call: ( ) , goto: ( ) , unwind_action: ( ) )
350
+ fn Call ( call: ( ) , goto: ReturnToArg , unwind_action: UnwindActionArg )
349
351
) ;
350
352
define ! ( "mir_unwind_resume" ,
351
353
/// A terminator that resumes the unwinding.
0 commit comments