Skip to content

Commit

Permalink
handle TerminatorKind::Yield by returning Err(Unpromotable)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissimpkins committed Feb 10, 2020
1 parent 4d1241f commit 9e78ce0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/librustc_mir/transform/promote_consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ impl<'tcx> Validator<'_, 'tcx> {
let terminator = self.body[loc.block].terminator();
match &terminator.kind {
TerminatorKind::Call { func, args, .. } => self.validate_call(func, args),
TerminatorKind::Yield { .. } => Err(Unpromotable),
kind => {
span_bug!(terminator.source_info.span, "{:?} not promotable", kind);
}
Expand Down

0 comments on commit 9e78ce0

Please sign in to comment.