File tree 1 file changed +9
-8
lines changed
src/librustc_mir/transform
1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -1064,14 +1064,15 @@ fn create_generator_resume_function<'tcx>(
1064
1064
cases. insert ( 0 , ( UNRESUMED , BasicBlock :: new ( 0 ) ) ) ;
1065
1065
1066
1066
// Panic when resumed on the returned or poisoned state
1067
- if let Some ( generator_kind) = body. generator_kind {
1068
- cases. insert ( 1 , ( RETURNED , insert_panic_block ( tcx,
1069
- body,
1070
- ResumedAfterReturn ( generator_kind) ) ) ) ;
1071
- cases. insert ( 2 , ( POISONED , insert_panic_block ( tcx,
1072
- body,
1073
- ResumedAfterPanic ( generator_kind) ) ) ) ;
1074
- } ;
1067
+ let generator_kind = body. generator_kind . unwrap ( ) ;
1068
+ cases. insert ( 1 , ( RETURNED , insert_panic_block (
1069
+ tcx,
1070
+ body,
1071
+ ResumedAfterReturn ( generator_kind) ) ) ) ;
1072
+ cases. insert ( 2 , ( POISONED , insert_panic_block (
1073
+ tcx,
1074
+ body,
1075
+ ResumedAfterPanic ( generator_kind) ) ) ) ;
1075
1076
1076
1077
insert_switch ( body, cases, & transform, TerminatorKind :: Unreachable ) ;
1077
1078
You can’t perform that action at this time.
0 commit comments