This commit is contained in:
Dinu Blanovschi 2023-11-04 20:04:02 +01:00
parent 241a654c07
commit a6b41aa6ba
2 changed files with 4 additions and 4 deletions

View File

@ -1482,7 +1482,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
hir::CaptureBy::Value { .. } if !place.deref_tys().any(Ty::is_ref) => {
ty::UpvarCapture::ByValue
}
hir::CaptureBy::Value { .. } | hir::CaptureBy::Ref => ty::UpvarCapture::ByRef(ty::ImmBorrow),
hir::CaptureBy::Value { .. } | hir::CaptureBy::Ref => {
ty::UpvarCapture::ByRef(ty::ImmBorrow)
}
}
}

View File

@ -2310,9 +2310,7 @@ impl<'a> Parser<'a> {
Err(errors::AsyncMoveOrderIncorrect { span: move_async_span }
.into_diagnostic(&self.sess.span_diagnostic))
} else {
Ok(CaptureBy::Value {
move_kw: move_kw_span,
})
Ok(CaptureBy::Value { move_kw: move_kw_span })
}
} else {
Ok(CaptureBy::Ref)