mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Swap inserts to keep the original ordering
This commit is contained in:
parent
cb58de8165
commit
38fa3783ce
@ -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…
Reference in New Issue
Block a user