From ca30e04c3de6f0b4ecb0f07caed5781fa7ae2d42 Mon Sep 17 00:00:00 2001 From: Aditya Jagrani Date: Fri, 19 Dec 2025 02:45:49 +0530 Subject: [PATCH] Add PartialEq> for [T; N] This fixes asymmetric equality between arrays and Vecs. Previously `Vec == [T; N]` was supported but `[T; N] == Vec PartialEq> for [T; N] +where + T: PartialEq, +{ + #[inline] + fn eq(&self, other: &Vec) -> bool { + self[..] == other[..] + } + + #[inline] + fn ne(&self, other: &Vec) -> bool { + self[..] != other[..] + } +} + + // NOTE: some less important impls are omitted to reduce code bloat // __impl_slice_eq2! { [A; $N], &'b [B; $N] } // __impl_slice_eq2! { [A; $N], &'b mut [B; $N] }