Only regular coroutines have movability
This commit is contained in:
parent
909dd864f1
commit
3320c09eab
25 changed files with 130 additions and 104 deletions
|
@ -938,8 +938,17 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
|
|||
|
||||
TerminatorKind::InlineAsm { .. } => self.check_op(ops::InlineAsm),
|
||||
|
||||
TerminatorKind::CoroutineDrop | TerminatorKind::Yield { .. } => {
|
||||
self.check_op(ops::Coroutine(hir::CoroutineKind::Coroutine))
|
||||
TerminatorKind::Yield { .. } => self.check_op(ops::Coroutine(
|
||||
self.tcx
|
||||
.coroutine_kind(self.body.source.def_id())
|
||||
.expect("Only expected to have a yield in a coroutine"),
|
||||
)),
|
||||
|
||||
TerminatorKind::CoroutineDrop => {
|
||||
span_bug!(
|
||||
self.body.source_info(location).span,
|
||||
"We should not encounter TerminatorKind::CoroutineDrop after coroutine transform"
|
||||
);
|
||||
}
|
||||
|
||||
TerminatorKind::UnwindTerminate(_) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue