Skip to content

Commit

Permalink
Don't run generator transform when there's a TyErr
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-schievink committed Jun 14, 2020
1 parent 06e4768 commit 4004bf1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/librustc_mir/transform/generator.rs
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 4004bf1

Please sign in to comment.