Change index for SwitchInt case

The indices do not matter here, and this fixes an index out of bounds
panic when compiling a generator that can unwind but not return.
This commit is contained in:
Jonas Schievink 2020-03-08 01:23:00 +01:00
parent 46aeef6e65
commit 8d9f633f4d

View file

@ -1108,7 +1108,7 @@ fn create_generator_resume_function<'tcx>(
if can_unwind {
cases.insert(
2,
1,
(POISONED, insert_panic_block(tcx, body, ResumedAfterPanic(generator_kind))),
);
}