Only regular coroutines have movability
This commit is contained in:
parent
909dd864f1
commit
3320c09eab
25 changed files with 130 additions and 104 deletions
|
@ -2577,7 +2577,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
|||
let message = outer_coroutine
|
||||
.and_then(|coroutine_did| {
|
||||
Some(match self.tcx.coroutine_kind(coroutine_did).unwrap() {
|
||||
CoroutineKind::Coroutine => format!("coroutine is not {trait_name}"),
|
||||
CoroutineKind::Coroutine(_) => format!("coroutine is not {trait_name}"),
|
||||
CoroutineKind::Desugared(
|
||||
CoroutineDesugaring::Async,
|
||||
CoroutineSource::Fn,
|
||||
|
@ -3169,7 +3169,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
|||
ObligationCauseCode::SizedCoroutineInterior(coroutine_def_id) => {
|
||||
let what = match self.tcx.coroutine_kind(coroutine_def_id) {
|
||||
None
|
||||
| Some(hir::CoroutineKind::Coroutine)
|
||||
| Some(hir::CoroutineKind::Coroutine(_))
|
||||
| Some(hir::CoroutineKind::Desugared(hir::CoroutineDesugaring::Gen, _)) => {
|
||||
"yield"
|
||||
}
|
||||
|
|
|
@ -1928,8 +1928,8 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
|||
fn describe_closure(&self, kind: hir::ClosureKind) -> &'static str {
|
||||
match kind {
|
||||
hir::ClosureKind::Closure => "a closure",
|
||||
hir::ClosureKind::Coroutine(kind, _) => match kind {
|
||||
hir::CoroutineKind::Coroutine => "a coroutine",
|
||||
hir::ClosureKind::Coroutine(kind) => match kind {
|
||||
hir::CoroutineKind::Coroutine(_) => "a coroutine",
|
||||
hir::CoroutineKind::Desugared(
|
||||
hir::CoroutineDesugaring::Async,
|
||||
hir::CoroutineSource::Block,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue