@@ -637,6 +637,10 @@ pub enum TerminatorKind<'tcx> {
637637 /// continue. Emitted by build::scope::diverge_cleanup.
638638 Resume ,
639639
640+ /// Indicates that the landing pad is finished and that the process
641+ /// should abort. Used to prevent unwinding for foreign items.
642+ Abort ,
643+
640644 /// Indicates a normal return. The return place should have
641645 /// been filled in by now. This should occur at most once.
642646 Return ,
@@ -759,7 +763,7 @@ impl<'tcx> TerminatorKind<'tcx> {
759763 match * self {
760764 Goto { target : ref b } => slice:: from_ref ( b) . into_cow ( ) ,
761765 SwitchInt { targets : ref b, .. } => b[ ..] . into_cow ( ) ,
762- Resume | GeneratorDrop => ( & [ ] ) . into_cow ( ) ,
766+ Resume | Abort | GeneratorDrop => ( & [ ] ) . into_cow ( ) ,
763767 Return => ( & [ ] ) . into_cow ( ) ,
764768 Unreachable => ( & [ ] ) . into_cow ( ) ,
765769 Call { destination : Some ( ( _, t) ) , cleanup : Some ( c) , .. } => vec ! [ t, c] . into_cow ( ) ,
@@ -794,7 +798,7 @@ impl<'tcx> TerminatorKind<'tcx> {
794798 match * self {
795799 Goto { target : ref mut b } => vec ! [ b] ,
796800 SwitchInt { targets : ref mut b, .. } => b. iter_mut ( ) . collect ( ) ,
797- Resume | GeneratorDrop => Vec :: new ( ) ,
801+ Resume | Abort | GeneratorDrop => Vec :: new ( ) ,
798802 Return => Vec :: new ( ) ,
799803 Unreachable => Vec :: new ( ) ,
800804 Call { destination : Some ( ( _, ref mut t) ) , cleanup : Some ( ref mut c) , .. } => vec ! [ t, c] ,
@@ -823,6 +827,7 @@ impl<'tcx> TerminatorKind<'tcx> {
823827 match * self {
824828 TerminatorKind :: Goto { .. } |
825829 TerminatorKind :: Resume |
830+ TerminatorKind :: Abort |
826831 TerminatorKind :: Return |
827832 TerminatorKind :: Unreachable |
828833 TerminatorKind :: GeneratorDrop |
@@ -918,6 +923,7 @@ impl<'tcx> TerminatorKind<'tcx> {
918923 Return => write ! ( fmt, "return" ) ,
919924 GeneratorDrop => write ! ( fmt, "generator_drop" ) ,
920925 Resume => write ! ( fmt, "resume" ) ,
926+ Abort => write ! ( fmt, "abort" ) ,
921927 Yield { ref value, .. } => write ! ( fmt, "_1 = suspend({:?})" , value) ,
922928 Unreachable => write ! ( fmt, "unreachable" ) ,
923929 Drop { ref location, .. } => write ! ( fmt, "drop({:?})" , location) ,
@@ -970,7 +976,7 @@ impl<'tcx> TerminatorKind<'tcx> {
970976 pub fn fmt_successor_labels ( & self ) -> Vec < Cow < ' static , str > > {
971977 use self :: TerminatorKind :: * ;
972978 match * self {
973- Return | Resume | Unreachable | GeneratorDrop => vec ! [ ] ,
979+ Return | Resume | Abort | Unreachable | GeneratorDrop => vec ! [ ] ,
974980 Goto { .. } => vec ! [ "" . into( ) ] ,
975981 SwitchInt { ref values, .. } => {
976982 values. iter ( )
@@ -2102,6 +2108,7 @@ impl<'tcx> TypeFoldable<'tcx> for Terminator<'tcx> {
21022108 } ,
21032109 GeneratorDrop => GeneratorDrop ,
21042110 Resume => Resume ,
2111+ Abort => Abort ,
21052112 Return => Return ,
21062113 Unreachable => Unreachable ,
21072114 FalseEdges { real_target, ref imaginary_targets } =>
@@ -2143,6 +2150,7 @@ impl<'tcx> TypeFoldable<'tcx> for Terminator<'tcx> {
21432150 } ,
21442151 Goto { .. } |
21452152 Resume |
2153+ Abort |
21462154 Return |
21472155 GeneratorDrop |
21482156 Unreachable |
0 commit comments