]> git.proxmox.com Git - rustc.git/blob - library/alloc/src/collections/vec_deque/macros.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / library / alloc / src / collections / vec_deque / macros.rs
1 macro_rules! __impl_slice_eq1 {
2 ([$($vars:tt)*] $lhs:ty, $rhs:ty, $($constraints:tt)*) => {
3 #[stable(feature = "vec_deque_partial_eq_slice", since = "1.17.0")]
4 impl<T, U, A: Allocator, $($vars)*> PartialEq<$rhs> for $lhs
5 where
6 T: PartialEq<U>,
7 $($constraints)*
8 {
9 fn eq(&self, other: &$rhs) -> bool {
10 if self.len() != other.len() {
11 return false;
12 }
13 let (sa, sb) = self.as_slices();
14 let (oa, ob) = other[..].split_at(sa.len());
15 sa == oa && sb == ob
16 }
17 }
18 }
19 }