Skip to content

Commit 9e78ce0

Browse files
committed
handle TerminatorKind::Yield by returning Err(Unpromotable)
1 parent 4d1241f commit 9e78ce0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/librustc_mir/transform/promote_consts.rs

+1
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ impl<'tcx> Validator<'_, 'tcx> {
463463
let terminator = self.body[loc.block].terminator();
464464
match &terminator.kind {
465465
TerminatorKind::Call { func, args, .. } => self.validate_call(func, args),
466+
TerminatorKind::Yield { .. } => Err(Unpromotable),
466467
kind => {
467468
span_bug!(terminator.source_info.span, "{:?} not promotable", kind);
468469
}

0 commit comments

Comments
 (0)