Swap inserts to keep the original ordering
This commit is contained in:
parent
cb58de8165
commit
38fa3783ce
1 changed files with 7 additions and 7 deletions
|
|
@ -1099,13 +1099,6 @@ fn create_generator_resume_function<'tcx>(
|
|||
// Panic when resumed on the returned or poisoned state
|
||||
let generator_kind = body.generator_kind.unwrap();
|
||||
|
||||
if can_return {
|
||||
cases.insert(
|
||||
1,
|
||||
(RETURNED, insert_panic_block(tcx, body, ResumedAfterReturn(generator_kind))),
|
||||
);
|
||||
}
|
||||
|
||||
if can_unwind {
|
||||
cases.insert(
|
||||
1,
|
||||
|
|
@ -1113,6 +1106,13 @@ fn create_generator_resume_function<'tcx>(
|
|||
);
|
||||
}
|
||||
|
||||
if can_return {
|
||||
cases.insert(
|
||||
1,
|
||||
(RETURNED, insert_panic_block(tcx, body, ResumedAfterReturn(generator_kind))),
|
||||
);
|
||||
}
|
||||
|
||||
insert_switch(body, cases, &transform, TerminatorKind::Unreachable);
|
||||
|
||||
make_generator_state_argument_indirect(tcx, def_id, body);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue