From cc7cef56d2fba4d3caceace0d3742076241cffe5 Mon Sep 17 00:00:00 2001 From: "addie.sh" Date: Thu, 2 Jul 2026 20:57:27 +0200 Subject: [PATCH] update TypeVisitable implementation --- compiler/rustc_type_ir/src/visit.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_type_ir/src/visit.rs b/compiler/rustc_type_ir/src/visit.rs index b77782b09ef85..e205855e146f5 100644 --- a/compiler/rustc_type_ir/src/visit.rs +++ b/compiler/rustc_type_ir/src/visit.rs @@ -167,7 +167,7 @@ impl, E: TypeVisitable> TypeVisitable for } } -impl> TypeVisitable for &T { +impl + ?Sized> TypeVisitable for &T { fn visit_with>(&self, visitor: &mut V) -> V::Result { (**self).visit_with(visitor) } @@ -179,7 +179,7 @@ impl> TypeVisitable for Arc { } } -impl> TypeVisitable for Box { +impl + ?Sized> TypeVisitable for Box { fn visit_with>(&self, visitor: &mut V) -> V::Result { (**self).visit_with(visitor) } @@ -209,14 +209,14 @@ impl, const N: usize> TypeVisitable for Smal // `TypeFoldable` isn't impl'd for `&[T]`. It doesn't make sense in the general // case, because we can't return a new slice. But note that there are a couple // of trivial impls of `TypeFoldable` for specific slice types elsewhere. -impl> TypeVisitable for &[T] { +impl> TypeVisitable for [T] { fn visit_with>(&self, visitor: &mut V) -> V::Result { walk_visitable_list!(visitor, self.iter()); V::Result::output() } } -impl> TypeVisitable for Box<[T]> { +impl> TypeVisitable for [T; N] { fn visit_with>(&self, visitor: &mut V) -> V::Result { walk_visitable_list!(visitor, self.iter()); V::Result::output()