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.rs26
1 files changed, 4 insertions, 22 deletions
diff --git a/crates/hir-ty/src/next_solver/ty.rs b/crates/hir-ty/src/next_solver/ty.rs
index 05f559c034..36c18ed772 100644
--- a/crates/hir-ty/src/next_solver/ty.rs
+++ b/crates/hir-ty/src/next_solver/ty.rs
@@ -33,7 +33,8 @@ use crate::{
CoroutineClosureIdWrapper, CoroutineIdWrapper, FnSig, GenericArgKind, PolyFnSig, Predicate,
Region, TraitRef, TypeAliasIdWrapper, Unnormalized,
abi::Safety,
- impl_foldable_for_interned_slice, impl_stored_interned, interned_slice,
+ impl_foldable_for_interned_slice, impl_foldable_for_stored_type, impl_stored_interned,
+ interned_slice,
util::{CoroutineArgsExt, IntegerTypeExt},
},
};
@@ -61,6 +62,7 @@ pub(super) struct TyInterned(WithCachedTypeInfo<TyKind<'static>>);
impl_internable!(gc; TyInterned);
impl_stored_interned!(TyInterned, Ty, StoredTy);
+impl_foldable_for_stored_type!(StoredTy);
const _: () = {
const fn is_copy<T: Copy>() {}
@@ -894,15 +896,6 @@ impl<'db> TypeVisitable<DbInterner<'db>> for Ty<'db> {
}
}
-impl<'db> TypeVisitable<DbInterner<'db>> for StoredTy {
- fn visit_with<V: rustc_type_ir::TypeVisitor<DbInterner<'db>>>(
- &self,
- visitor: &mut V,
- ) -> V::Result {
- self.as_ref().visit_with(visitor)
- }
-}
-
impl<'db> TypeSuperVisitable<DbInterner<'db>> for Ty<'db> {
fn super_visit_with<V: rustc_type_ir::TypeVisitor<DbInterner<'db>>>(
&self,
@@ -969,18 +962,6 @@ impl<'db> TypeFoldable<DbInterner<'db>> for Ty<'db> {
}
}
-impl<'db> TypeFoldable<DbInterner<'db>> for StoredTy {
- fn try_fold_with<F: rustc_type_ir::FallibleTypeFolder<DbInterner<'db>>>(
- self,
- folder: &mut F,
- ) -> Result<Self, F::Error> {
- Ok(self.as_ref().try_fold_with(folder)?.store())
- }
- fn fold_with<F: rustc_type_ir::TypeFolder<DbInterner<'db>>>(self, folder: &mut F) -> Self {
- self.as_ref().fold_with(folder).store()
- }
-}
-
impl<'db> TypeSuperFoldable<DbInterner<'db>> for Ty<'db> {
fn try_super_fold_with<F: rustc_type_ir::FallibleTypeFolder<DbInterner<'db>>>(
self,
@@ -1422,6 +1403,7 @@ impl<'db> rustc_type_ir::inherent::Ty<DbInterner<'db>> for Ty<'db> {
interned_slice!(TysStorage, Tys, StoredTys, tys, Ty<'db>, Ty<'static>);
impl_foldable_for_interned_slice!(Tys);
+impl_foldable_for_stored_type!(StoredTys);
impl<'db> Tys<'db> {
#[inline]