Skip to content

Commit 231911e

Browse files
authored
Rollup merge of rust-lang#73339 - jonas-schievink:unbug, r=estebank
Don't run generator transform when there's a TyErr Not sure if this might cause any problems later on, but we shouldn't be hitting codegen or const eval for the produced MIR anyways, so it should be fine. cc rust-lang#72685 (comment)
2 parents 5d7a1ca + 4004bf1 commit 231911e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc_mir/transform/generator.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,11 @@ impl<'tcx> MirPass<'tcx> for StateTransform {
12191219
movability == hir::Movability::Movable,
12201220
)
12211221
}
1222-
_ => bug!(),
1222+
_ => {
1223+
tcx.sess
1224+
.delay_span_bug(body.span, &format!("unexpected generator type {}", gen_ty));
1225+
return;
1226+
}
12231227
};
12241228

12251229
// Compute GeneratorState<yield_ty, return_ty>

0 commit comments

Comments
 (0)