1
Fork 0

Only regular coroutines have movability

This commit is contained in:
Michael Goulet 2023-12-25 16:56:12 +00:00
parent 909dd864f1
commit 3320c09eab
25 changed files with 130 additions and 104 deletions

View file

@ -90,13 +90,10 @@ impl<'a, 'hir> Visitor<'hir> for CheckLoopVisitor<'a, 'hir> {
}) => {
// FIXME(coroutines): This doesn't handle coroutines correctly
let cx = match kind {
hir::ClosureKind::Coroutine(
hir::CoroutineKind::Desugared(
hir::CoroutineDesugaring::Async,
hir::CoroutineSource::Block,
),
_,
) => AsyncClosure(fn_decl_span),
hir::ClosureKind::Coroutine(hir::CoroutineKind::Desugared(
hir::CoroutineDesugaring::Async,
hir::CoroutineSource::Block,
)) => AsyncClosure(fn_decl_span),
_ => Closure(fn_decl_span),
};
self.visit_fn_decl(fn_decl);