@@ -374,8 +374,7 @@ impl<'tcx> TerminatorKind<'tcx> {
374
374
| Yield { resume : ref t, drop : Some ( u) , .. }
375
375
| Drop { target : ref t, unwind : UnwindAction :: Cleanup ( u) , .. }
376
376
| Assert { target : ref t, unwind : UnwindAction :: Cleanup ( u) , .. }
377
- | FalseUnwind { real_target : ref t, unwind : UnwindAction :: Cleanup ( u) }
378
- | InlineAsm { destination : Some ( ref t) , unwind : UnwindAction :: Cleanup ( u) , .. } => {
377
+ | FalseUnwind { real_target : ref t, unwind : UnwindAction :: Cleanup ( u) } => {
379
378
slice:: from_ref ( t) . into_iter ( ) . copied ( ) . chain ( Some ( u) )
380
379
}
381
380
Goto { target : ref t }
@@ -384,20 +383,19 @@ impl<'tcx> TerminatorKind<'tcx> {
384
383
| Yield { resume : ref t, drop : None , .. }
385
384
| Drop { target : ref t, unwind : _, .. }
386
385
| Assert { target : ref t, unwind : _, .. }
387
- | FalseUnwind { real_target : ref t, unwind : _ }
388
- | InlineAsm { destination : None , unwind : UnwindAction :: Cleanup ( ref t) , .. }
389
- | InlineAsm { destination : Some ( ref t) , unwind : _, .. } => {
386
+ | FalseUnwind { real_target : ref t, unwind : _ } => {
390
387
slice:: from_ref ( t) . into_iter ( ) . copied ( ) . chain ( None )
391
388
}
392
389
UnwindResume
393
390
| UnwindTerminate ( _)
394
391
| CoroutineDrop
395
392
| Return
396
393
| Unreachable
397
- | Call { target : None , unwind : _, .. }
398
- | InlineAsm { destination : None , unwind : _ , .. } => {
399
- ( & [ ] ) . into_iter ( ) . copied ( ) . chain ( None )
394
+ | Call { target : None , unwind : _, .. } => ( & [ ] ) . into_iter ( ) . copied ( ) . chain ( None ) ,
395
+ InlineAsm { ref targets , unwind : UnwindAction :: Cleanup ( u ) , .. } => {
396
+ targets . iter ( ) . copied ( ) . chain ( Some ( u ) )
400
397
}
398
+ InlineAsm { ref targets, unwind : _, .. } => targets. iter ( ) . copied ( ) . chain ( None ) ,
401
399
SwitchInt { ref targets, .. } => targets. targets . iter ( ) . copied ( ) . chain ( None ) ,
402
400
FalseEdge { ref real_target, imaginary_target } => {
403
401
slice:: from_ref ( real_target) . into_iter ( ) . copied ( ) . chain ( Some ( imaginary_target) )
@@ -413,30 +411,28 @@ impl<'tcx> TerminatorKind<'tcx> {
413
411
| Yield { resume : ref mut t, drop : Some ( ref mut u) , .. }
414
412
| Drop { target : ref mut t, unwind : UnwindAction :: Cleanup ( ref mut u) , .. }
415
413
| Assert { target : ref mut t, unwind : UnwindAction :: Cleanup ( ref mut u) , .. }
416
- | FalseUnwind { real_target : ref mut t, unwind : UnwindAction :: Cleanup ( ref mut u) }
417
- | InlineAsm {
418
- destination : Some ( ref mut t) ,
419
- unwind : UnwindAction :: Cleanup ( ref mut u) ,
420
- ..
421
- } => slice:: from_mut ( t) . into_iter ( ) . chain ( Some ( u) ) ,
414
+ | FalseUnwind { real_target : ref mut t, unwind : UnwindAction :: Cleanup ( ref mut u) } => {
415
+ slice:: from_mut ( t) . into_iter ( ) . chain ( Some ( u) )
416
+ }
422
417
Goto { target : ref mut t }
423
418
| Call { target : None , unwind : UnwindAction :: Cleanup ( ref mut t) , .. }
424
419
| Call { target : Some ( ref mut t) , unwind : _, .. }
425
420
| Yield { resume : ref mut t, drop : None , .. }
426
421
| Drop { target : ref mut t, unwind : _, .. }
427
422
| Assert { target : ref mut t, unwind : _, .. }
428
- | FalseUnwind { real_target : ref mut t, unwind : _ }
429
- | InlineAsm { destination : None , unwind : UnwindAction :: Cleanup ( ref mut t) , .. }
430
- | InlineAsm { destination : Some ( ref mut t) , unwind : _, .. } => {
423
+ | FalseUnwind { real_target : ref mut t, unwind : _ } => {
431
424
slice:: from_mut ( t) . into_iter ( ) . chain ( None )
432
425
}
433
426
UnwindResume
434
427
| UnwindTerminate ( _)
435
428
| CoroutineDrop
436
429
| Return
437
430
| Unreachable
438
- | Call { target : None , unwind : _, .. }
439
- | InlineAsm { destination : None , unwind : _, .. } => ( & mut [ ] ) . into_iter ( ) . chain ( None ) ,
431
+ | Call { target : None , unwind : _, .. } => ( & mut [ ] ) . into_iter ( ) . chain ( None ) ,
432
+ InlineAsm { ref mut targets, unwind : UnwindAction :: Cleanup ( ref mut u) , .. } => {
433
+ targets. iter_mut ( ) . chain ( Some ( u) )
434
+ }
435
+ InlineAsm { ref mut targets, unwind : _, .. } => targets. iter_mut ( ) . chain ( None ) ,
440
436
SwitchInt { ref mut targets, .. } => targets. targets . iter_mut ( ) . chain ( None ) ,
441
437
FalseEdge { ref mut real_target, ref mut imaginary_target } => {
442
438
slice:: from_mut ( real_target) . into_iter ( ) . chain ( Some ( imaginary_target) )
@@ -511,7 +507,7 @@ pub enum TerminatorEdges<'mir, 'tcx> {
511
507
Double ( BasicBlock , BasicBlock ) ,
512
508
/// Special action for `Yield`, `Call` and `InlineAsm` terminators.
513
509
AssignOnReturn {
514
- return_ : Option < BasicBlock > ,
510
+ return_ : & ' mir [ BasicBlock ] ,
515
511
/// The cleanup block, if it exists.
516
512
cleanup : Option < BasicBlock > ,
517
513
place : CallReturnPlaces < ' mir , ' tcx > ,
@@ -575,31 +571,37 @@ impl<'tcx> TerminatorKind<'tcx> {
575
571
TerminatorEdges :: Double ( real_target, imaginary_target)
576
572
}
577
573
578
- Yield { resume : target, drop, resume_arg, value : _ } => {
574
+ Yield { resume : ref target, drop, resume_arg, value : _ } => {
579
575
TerminatorEdges :: AssignOnReturn {
580
- return_ : Some ( target) ,
576
+ return_ : slice :: from_ref ( target) ,
581
577
cleanup : drop,
582
578
place : CallReturnPlaces :: Yield ( resume_arg) ,
583
579
}
584
580
}
585
581
586
- Call { unwind, destination, target, func : _, args : _, fn_span : _, call_source : _ } => {
587
- TerminatorEdges :: AssignOnReturn {
588
- return_ : target,
589
- cleanup : unwind. cleanup_block ( ) ,
590
- place : CallReturnPlaces :: Call ( destination) ,
591
- }
592
- }
582
+ Call {
583
+ unwind,
584
+ destination,
585
+ ref target,
586
+ func : _,
587
+ args : _,
588
+ fn_span : _,
589
+ call_source : _,
590
+ } => TerminatorEdges :: AssignOnReturn {
591
+ return_ : target. as_ref ( ) . map ( slice:: from_ref) . unwrap_or_default ( ) ,
592
+ cleanup : unwind. cleanup_block ( ) ,
593
+ place : CallReturnPlaces :: Call ( destination) ,
594
+ } ,
593
595
594
596
InlineAsm {
595
597
template : _,
596
598
ref operands,
597
599
options : _,
598
600
line_spans : _,
599
- destination ,
601
+ ref targets ,
600
602
unwind,
601
603
} => TerminatorEdges :: AssignOnReturn {
602
- return_ : destination ,
604
+ return_ : targets ,
603
605
cleanup : unwind. cleanup_block ( ) ,
604
606
place : CallReturnPlaces :: InlineAsm ( operands) ,
605
607
} ,
0 commit comments