Skip to content

Commit 5bbcdf5

Browse files
authored
Rollup merge of #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 #72685 (comment)
2 parents c65f39d + 4004bf1 commit 5bbcdf5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc_mir/transform/generator.rs

+5-1
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)