File tree 1 file changed +2
-13
lines changed
compiler/rustc_mir/src/transform
1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -125,28 +125,17 @@ impl<'tcx> MirPass<'tcx> for AbortUnwindingCalls {
125
125
let abort_bb = body. basic_blocks_mut ( ) . push ( bb) ;
126
126
127
127
for bb in calls_to_terminate {
128
- let cleanup = get_cleanup ( body. basic_blocks_mut ( ) [ bb] . terminator_mut ( ) ) ;
128
+ let cleanup = body. basic_blocks_mut ( ) [ bb] . terminator_mut ( ) . unwind_mut ( ) . unwrap ( ) ;
129
129
* cleanup = Some ( abort_bb) ;
130
130
}
131
131
}
132
132
133
133
for id in cleanups_to_remove {
134
- let cleanup = get_cleanup ( body. basic_blocks_mut ( ) [ id] . terminator_mut ( ) ) ;
134
+ let cleanup = body. basic_blocks_mut ( ) [ id] . terminator_mut ( ) . unwind_mut ( ) . unwrap ( ) ;
135
135
* cleanup = None ;
136
136
}
137
137
138
138
// We may have invalidated some `cleanup` blocks so clean those up now.
139
139
super :: simplify:: remove_dead_blocks ( tcx, body) ;
140
140
}
141
141
}
142
-
143
- fn get_cleanup < ' a > ( t : & ' a mut Terminator < ' _ > ) -> & ' a mut Option < BasicBlock > {
144
- match & mut t. kind {
145
- TerminatorKind :: Call { cleanup, .. }
146
- | TerminatorKind :: Drop { unwind : cleanup, .. }
147
- | TerminatorKind :: DropAndReplace { unwind : cleanup, .. }
148
- | TerminatorKind :: Assert { cleanup, .. }
149
- | TerminatorKind :: FalseUnwind { unwind : cleanup, .. } => cleanup,
150
- _ => unreachable ! ( ) ,
151
- }
152
- }
You can’t perform that action at this time.
0 commit comments