diff options
| author | Michael Goulet <michael@errs.io> | 2023-12-25 16:56:12 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-12-25 21:13:41 +0000 |
| commit | 3320c09eabb635fd6bf7a78a83a601a3d72193e8 (patch) | |
| tree | 8c48b35bd60678d7b5e963d76f2d6f9e049ca924 /compiler/rustc_const_eval | |
| parent | 909dd864f140b5aeefd116d60ec6bffa4271617a (diff) | |
| download | rust-3320c09eabb635fd6bf7a78a83a601a3d72193e8.tar.gz rust-3320c09eabb635fd6bf7a78a83a601a3d72193e8.zip | |
Only regular coroutines have movability
Diffstat (limited to 'compiler/rustc_const_eval')
| -rw-r--r-- | compiler/rustc_const_eval/src/transform/check_consts/check.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/check.rs b/compiler/rustc_const_eval/src/transform/check_consts/check.rs index bf7adf8f44c..0f2b4512fea 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/check.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/check.rs @@ -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(_) => { |
