File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
src/librustc_mir/transform Expand file tree Collapse file tree 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>(
10641064 cases. insert ( 0 , ( UNRESUMED , BasicBlock :: new ( 0 ) ) ) ;
10651065
10661066 // 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) ) ) ) ;
10751076
10761077 insert_switch ( body, cases, & transform, TerminatorKind :: Unreachable ) ;
10771078
You can’t perform that action at this time.
0 commit comments