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.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/hir-ty/src/next_solver/ty.rs b/crates/hir-ty/src/next_solver/ty.rs index 305da50b6d..85534e42a8 100644 --- a/crates/hir-ty/src/next_solver/ty.rs +++ b/crates/hir-ty/src/next_solver/ty.rs @@ -8,6 +8,7 @@ use hir_def::{ }; use hir_def::{TraitId, type_ref::Rawness}; use intern::{Interned, InternedRef, impl_internable}; +use macros::GenericTypeVisitable; use rustc_abi::{Float, Integer, Size}; use rustc_ast_ir::{Mutability, try_visit, visit::VisitorResult}; use rustc_type_ir::{ @@ -51,7 +52,7 @@ pub struct Ty<'db> { pub(super) interned: InternedRef<'db, TyInterned>, } -#[derive(PartialEq, Eq, Hash)] +#[derive(PartialEq, Eq, Hash, GenericTypeVisitable)] #[repr(align(4))] // Required for `GenericArg` bit-tagging. pub(super) struct TyInterned(WithCachedTypeInfo<TyKind<'static>>); @@ -750,8 +751,9 @@ impl<'db> IntoKind for Ty<'db> { impl<'db, V: super::WorldExposer> GenericTypeVisitable<V> for Ty<'db> { fn generic_visit_with(&self, visitor: &mut V) { - visitor.on_interned(self.interned); - self.kind().generic_visit_with(visitor); + if visitor.on_interned(self.interned).is_continue() { + self.kind().generic_visit_with(visitor); + } } } |