From 0ba7ddc98be6c551c643420825c1704c817d1f00 Mon Sep 17 00:00:00 2001 From: Not-Sarthak Date: Sun, 1 Mar 2026 12:32:48 +0530 Subject: [PATCH 1/2] Add missing impl PartialEq> for [T; N] The forward direction (Vec == [T; N]) has been stable since 1.0.0, but the reverse ([T; N] == Vec) was missing. This adds the symmetric implementation using the existing __impl_slice_eq1 macro. --- library/alloc/src/vec/partial_eq.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/alloc/src/vec/partial_eq.rs b/library/alloc/src/vec/partial_eq.rs index 5e620c4b2efe7..2969335d35a26 100644 --- a/library/alloc/src/vec/partial_eq.rs +++ b/library/alloc/src/vec/partial_eq.rs @@ -34,11 +34,11 @@ __impl_slice_eq1! { [] Cow<'_, [T]>, &[U] where T: Clone, #[stable(feature = "ru __impl_slice_eq1! { [] Cow<'_, [T]>, &mut [U] where T: Clone, #[stable(feature = "rust1", since = "1.0.0")] } __impl_slice_eq1! { [A: Allocator, const N: usize] Vec, [U; N], #[stable(feature = "rust1", since = "1.0.0")] } __impl_slice_eq1! { [A: Allocator, const N: usize] Vec, &[U; N], #[stable(feature = "rust1", since = "1.0.0")] } +__impl_slice_eq1! { [A: Allocator, const N: usize] [T; N], Vec, #[stable(feature = "partialeq_vec_for_array", since = "CURRENT_RUSTC_VERSION")] } // NOTE: some less important impls are omitted to reduce code bloat // FIXME(Centril): Reconsider this? //__impl_slice_eq1! { [const N: usize] Vec, &mut [B; N], } -//__impl_slice_eq1! { [const N: usize] [A; N], Vec, } //__impl_slice_eq1! { [const N: usize] &[A; N], Vec, } //__impl_slice_eq1! { [const N: usize] &mut [A; N], Vec, } //__impl_slice_eq1! { [const N: usize] Cow<'a, [A]>, [B; N], } From d2799ac8bf06cefbfdfd60f6e1063b168573efb6 Mon Sep 17 00:00:00 2001 From: Not-Sarthak Date: Sun, 1 Mar 2026 14:12:56 +0530 Subject: [PATCH 2/2] Update expected stderr for too_generic_eval_ice test The new PartialEq> impl for [T; N] adds one more impl to the suggestion list, changing "and 11 others" to "and 12 others". --- tests/ui/consts/too_generic_eval_ice.current.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ui/consts/too_generic_eval_ice.current.stderr b/tests/ui/consts/too_generic_eval_ice.current.stderr index 02bcaee80154f..414ed8a0c74ff 100644 --- a/tests/ui/consts/too_generic_eval_ice.current.stderr +++ b/tests/ui/consts/too_generic_eval_ice.current.stderr @@ -38,7 +38,7 @@ LL | [5; Self::HOST_SIZE] == [6; 0] `&[u8]` implements `PartialEq` `&mut [T]` implements `PartialEq>` `&mut [T]` implements `PartialEq<[U; N]>` - and 11 others + and 12 others error: aborting due to 4 previous errors