Skip to content

Commit

Permalink
Rollup merge of #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 #72685 (comment)
  • Loading branch information
Dylan-DPC authored Jun 16, 2020
2 parents c65f39d + 4004bf1 commit 5bbcdf5
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 5bbcdf5

Please sign in to comment.