Skip to content

Commit e1af5cb

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 88a3b0e + 4004bf1 commit e1af5cb

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
@@ -1222,7 +1222,11 @@ impl<'tcx> MirPass<'tcx> for StateTransform {
12221222
movability == hir::Movability::Movable,
12231223
)
12241224
}
1225-
_ => bug!(),
1225+
_ => {
1226+
tcx.sess
1227+
.delay_span_bug(body.span, &format!("unexpected generator type {}", gen_ty));
1228+
return;
1229+
}
12261230
};
12271231

12281232
// Compute GeneratorState<yield_ty, return_ty>

0 commit comments

Comments
 (0)