Skip to content

Commit 4004bf1

Browse files
Don't run generator transform when there's a TyErr
1 parent 06e4768 commit 4004bf1

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)