Make closures carry their own ClosureKind, rather than deducing what it is from movability
This commit is contained in:
parent
981fc6e174
commit
909dd864f1
20 changed files with 338 additions and 326 deletions
|
@ -1042,13 +1042,15 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
|||
}
|
||||
hir::ExprKind::Closure(hir::Closure {
|
||||
capture_clause: hir::CaptureBy::Ref,
|
||||
body,
|
||||
kind,
|
||||
..
|
||||
}) => {
|
||||
let body = map.body(*body);
|
||||
if !matches!(
|
||||
body.coroutine_kind,
|
||||
Some(hir::CoroutineKind::Desugared(hir::CoroutineDesugaring::Async, _))
|
||||
kind,
|
||||
hir::ClosureKind::Coroutine(
|
||||
hir::CoroutineKind::Desugared(hir::CoroutineDesugaring::Async, _),
|
||||
_
|
||||
)
|
||||
) {
|
||||
closure_span = Some(expr.span.shrink_to_lo());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue