File tree 1 file changed +2
-9
lines changed
compiler/rustc_mir_transform/src
1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -1199,7 +1199,7 @@ fn insert_panic_block<'tcx>(
1199
1199
message : AssertMessage < ' tcx > ,
1200
1200
) -> BasicBlock {
1201
1201
let assert_block = BasicBlock :: new ( body. basic_blocks . len ( ) ) ;
1202
- let term = TerminatorKind :: Assert {
1202
+ let kind = TerminatorKind :: Assert {
1203
1203
cond : Operand :: Constant ( Box :: new ( ConstOperand {
1204
1204
span : body. span ,
1205
1205
user_ty : None ,
@@ -1211,14 +1211,7 @@ fn insert_panic_block<'tcx>(
1211
1211
unwind : UnwindAction :: Continue ,
1212
1212
} ;
1213
1213
1214
- let source_info = SourceInfo :: outermost ( body. span ) ;
1215
- body. basic_blocks_mut ( ) . push ( BasicBlockData {
1216
- statements : Vec :: new ( ) ,
1217
- terminator : Some ( Terminator { source_info, kind : term } ) ,
1218
- is_cleanup : false ,
1219
- } ) ;
1220
-
1221
- assert_block
1214
+ insert_term_block ( body, kind)
1222
1215
}
1223
1216
1224
1217
fn can_return < ' tcx > ( tcx : TyCtxt < ' tcx > , body : & Body < ' tcx > , param_env : ty:: ParamEnv < ' tcx > ) -> bool {
You can’t perform that action at this time.
0 commit comments