`VecDeque` implements `PartialEq<&'b mut [B; N]>` but `VecDeque` does not


#1

Looking at the VecDeque and Vec doc pages, I noticed an inconsistency that I don’t see an obvious reason for.

VecDeque implements basically three categories of PartialEq with arrays:

  • impl<'a, 'b, A, B> PartialEq<[B; N]> for VecDeque<A>
  • impl<'a, 'b, A, B> PartialEq<&'b [B; N]> for VecDeque<A>
  • impl<'a, 'b, A, B> PartialEq<&'b mut [B; N]> for VecDeque<A>

(Where N is an integer between 0 and 32 inclusive)

But Vec only implements the first two.

Is there a reason for this? Should the third variant be added for Vec?


#2

Maybe because arrays are a pain in the rear right now without type level integers/const generics and a Vec is easily coercable to a slice (whereas VecDeque isn’t) and so nobody ever bothered/noticed. But I’m just speculating.