Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/next_solver/ty.rs')
-rw-r--r--crates/hir-ty/src/next_solver/ty.rs37
1 files changed, 19 insertions, 18 deletions
diff --git a/crates/hir-ty/src/next_solver/ty.rs b/crates/hir-ty/src/next_solver/ty.rs
index 95ee00d275..1443e2f0b3 100644
--- a/crates/hir-ty/src/next_solver/ty.rs
+++ b/crates/hir-ty/src/next_solver/ty.rs
@@ -26,7 +26,7 @@ use rustc_type_ir::{
use crate::{
ImplTraitId,
- db::HirDatabase,
+ db::{HirDatabase, InternedCoroutine},
next_solver::{
AdtDef, AliasTy, Binder, CallableIdWrapper, Clause, ClauseKind, ClosureIdWrapper, Const,
CoroutineIdWrapper, FnSig, GenericArg, PolyFnSig, Region, TraitRef, TypeAliasIdWrapper,
@@ -546,23 +546,6 @@ impl<'db> Ty<'db> {
.collect()
})
}
- ImplTraitId::AsyncBlockTypeImplTrait(def, _) => {
- let krate = def.module(db).krate();
- if let Some(future_trait) = LangItem::Future.resolve_trait(db, krate) {
- // This is only used by type walking.
- // Parameters will be walked outside, and projection predicate is not used.
- // So just provide the Future trait.
- let impl_bound = TraitRef::new(
- interner,
- future_trait.into(),
- GenericArgs::new_from_iter(interner, []),
- )
- .upcast(interner);
- Some(vec![impl_bound])
- } else {
- None
- }
- }
}
}
TyKind::Param(param) => {
@@ -592,6 +575,24 @@ impl<'db> Ty<'db> {
_ => None,
}
}
+ TyKind::Coroutine(coroutine_id, _args) => {
+ let InternedCoroutine(owner, _) = coroutine_id.0.loc(db);
+ let krate = owner.module(db).krate();
+ if let Some(future_trait) = LangItem::Future.resolve_trait(db, krate) {
+ // This is only used by type walking.
+ // Parameters will be walked outside, and projection predicate is not used.
+ // So just provide the Future trait.
+ let impl_bound = TraitRef::new(
+ interner,
+ future_trait.into(),
+ GenericArgs::new_from_iter(interner, []),
+ )
+ .upcast(interner);
+ Some(vec![impl_bound])
+ } else {
+ None
+ }
+ }
_ => None,
}
}