1
Fork 0

handle TerminatorKind::Yield by returning Err(Unpromotable)

This commit is contained in:
Chris Simpkins 2020-02-10 11:31:55 -05:00
parent 4d1241f515
commit 9e78ce068b

View file

@ -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);
}