Skip to content

Commit

Permalink
Rollup merge of rust-lang#73339 - jonas-schievink:unbug, r=estebank
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
Manishearth authored Jun 16, 2020
2 parents 88a3b0e + 4004bf1 commit e1af5cb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/librustc_mir/transform/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,11 @@ impl<'tcx> MirPass<'tcx> for StateTransform {
movability == hir::Movability::Movable,
)
}
_ => bug!(),
_ => {
tcx.sess
.delay_span_bug(body.span, &format!("unexpected generator type {}", gen_ty));
return;
}
};

// Compute GeneratorState<yield_ty, return_ty>
Expand Down

0 comments on commit e1af5cb

Please sign in to comment.