Skip to content

Commit 8d9f633

Browse files
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.
1 parent 46aeef6 commit 8d9f633

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_mir/transform/generator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ fn create_generator_resume_function<'tcx>(
11081108

11091109
if can_unwind {
11101110
cases.insert(
1111-
2,
1111+
1,
11121112
(POISONED, insert_panic_block(tcx, body, ResumedAfterPanic(generator_kind))),
11131113
);
11141114
}

0 commit comments

Comments
 (0)