@@ -4,11 +4,11 @@ use crate::alloc::Allocator;
44use crate :: borrow:: Cow ;
55
66macro_rules! __impl_slice_eq1 {
7- ( [ $( $vars: tt) * ] $lhs: ty, $rhs: ty $( where $ty: ty: $bound: ident) ?, #[ $stability: meta] ) => {
8- #[ $stability]
9- impl <T , U , $( $vars) * > PartialEq <$rhs> for $lhs
7+ ( $ ( $const : ident , ) ? [ $( $vars: tt) * ] $lhs: ty, $rhs: ty $( where $ty: ty: $bound: ident) ?, $ ( #[ $stability: meta] ) + ) => {
8+ $ ( #[ $stability] ) +
9+ impl <T , U , $( $vars) * > $ ( $const ) ? PartialEq <$rhs> for $lhs
1010 where
11- T : PartialEq <U >,
11+ T : $ ( [ $const ] ) ? PartialEq <U >,
1212 $( $ty: $bound) ?
1313 {
1414 #[ inline]
@@ -19,21 +19,21 @@ macro_rules! __impl_slice_eq1 {
1919 }
2020}
2121
22- __impl_slice_eq1 ! { [ A1 : Allocator , A2 : Allocator ] Vec <T , A1 >, Vec <U , A2 >, #[ stable( feature = "rust1" , since = "1.0.0" ) ] }
23- __impl_slice_eq1 ! { [ A : Allocator ] Vec <T , A >, & [ U ] , #[ stable( feature = "rust1" , since = "1.0.0" ) ] }
24- __impl_slice_eq1 ! { [ A : Allocator ] Vec <T , A >, & mut [ U ] , #[ stable( feature = "rust1" , since = "1.0.0" ) ] }
25- __impl_slice_eq1 ! { [ A : Allocator ] & [ T ] , Vec <U , A >, #[ stable( feature = "partialeq_vec_for_ref_slice" , since = "1.46.0" ) ] }
26- __impl_slice_eq1 ! { [ A : Allocator ] & mut [ T ] , Vec <U , A >, #[ stable( feature = "partialeq_vec_for_ref_slice" , since = "1.46.0" ) ] }
27- __impl_slice_eq1 ! { [ A : Allocator ] Vec <T , A >, [ U ] , #[ stable( feature = "partialeq_vec_for_slice" , since = "1.48.0" ) ] }
28- __impl_slice_eq1 ! { [ A : Allocator ] [ T ] , Vec <U , A >, #[ stable( feature = "partialeq_vec_for_slice" , since = "1.48.0" ) ] }
22+ __impl_slice_eq1 ! { const , [ A1 : Allocator , A2 : Allocator ] Vec <T , A1 >, Vec <U , A2 >, # [ rustc_const_unstable ( feature = "const_cmp" , issue = "143800" ) ] #[ stable( feature = "rust1" , since = "1.0.0" ) ] }
23+ __impl_slice_eq1 ! { const , [ A : Allocator ] Vec <T , A >, & [ U ] , # [ rustc_const_unstable ( feature = "const_cmp" , issue = "143800" ) ] #[ stable( feature = "rust1" , since = "1.0.0" ) ] }
24+ __impl_slice_eq1 ! { const , [ A : Allocator ] Vec <T , A >, & mut [ U ] , # [ rustc_const_unstable ( feature = "const_cmp" , issue = "143800" ) ] #[ stable( feature = "rust1" , since = "1.0.0" ) ] }
25+ __impl_slice_eq1 ! { const , [ A : Allocator ] & [ T ] , Vec <U , A >, # [ rustc_const_unstable ( feature = "const_cmp" , issue = "143800" ) ] #[ stable( feature = "partialeq_vec_for_ref_slice" , since = "1.46.0" ) ] }
26+ __impl_slice_eq1 ! { const , [ A : Allocator ] & mut [ T ] , Vec <U , A >, # [ rustc_const_unstable ( feature = "const_cmp" , issue = "143800" ) ] #[ stable( feature = "partialeq_vec_for_ref_slice" , since = "1.46.0" ) ] }
27+ __impl_slice_eq1 ! { const , [ A : Allocator ] Vec <T , A >, [ U ] , #[ rustc_const_unstable ( feature = "const_cmp" , issue = "143800" ) ] # [ stable( feature = "partialeq_vec_for_slice" , since = "1.48.0" ) ] }
28+ __impl_slice_eq1 ! { const , [ A : Allocator ] [ T ] , Vec <U , A >, #[ rustc_const_unstable ( feature = "const_cmp" , issue = "143800" ) ] # [ stable( feature = "partialeq_vec_for_slice" , since = "1.48.0" ) ] }
2929#[ cfg( not( no_global_oom_handling) ) ]
3030__impl_slice_eq1 ! { [ A : Allocator ] Cow <' _, [ T ] >, Vec <U , A > where T : Clone , #[ stable( feature = "rust1" , since = "1.0.0" ) ] }
3131#[ cfg( not( no_global_oom_handling) ) ]
3232__impl_slice_eq1 ! { [ ] Cow <' _, [ T ] >, & [ U ] where T : Clone , #[ stable( feature = "rust1" , since = "1.0.0" ) ] }
3333#[ cfg( not( no_global_oom_handling) ) ]
3434__impl_slice_eq1 ! { [ ] Cow <' _, [ T ] >, & mut [ U ] where T : Clone , #[ stable( feature = "rust1" , since = "1.0.0" ) ] }
35- __impl_slice_eq1 ! { [ A : Allocator , const N : usize ] Vec <T , A >, [ U ; N ] , #[ stable( feature = "rust1" , since = "1.0.0" ) ] }
36- __impl_slice_eq1 ! { [ A : Allocator , const N : usize ] Vec <T , A >, & [ U ; N ] , #[ stable( feature = "rust1" , since = "1.0.0" ) ] }
35+ __impl_slice_eq1 ! { const , [ A : Allocator , const N : usize ] Vec <T , A >, [ U ; N ] , # [ rustc_const_unstable ( feature = "const_cmp" , issue = "143800" ) ] #[ stable( feature = "rust1" , since = "1.0.0" ) ] }
36+ __impl_slice_eq1 ! { const , [ A : Allocator , const N : usize ] Vec <T , A >, & [ U ; N ] , # [ rustc_const_unstable ( feature = "const_cmp" , issue = "143800" ) ] #[ stable( feature = "rust1" , since = "1.0.0" ) ] }
3737
3838// NOTE: some less important impls are omitted to reduce code bloat
3939// FIXME(Centril): Reconsider this?
0 commit comments