11use crate :: cmp:: BytewiseEq ;
22
33#[ stable( feature = "rust1" , since = "1.0.0" ) ]
4- impl < T , U , const N : usize > PartialEq < [ U ; N ] > for [ T ; N ]
4+ #[ rustc_const_unstable( feature = "const_cmp" , issue = "143800" ) ]
5+ impl < T , U , const N : usize > const PartialEq < [ U ; N ] > for [ T ; N ]
56where
6- T : PartialEq < U > ,
7+ T : ~ const PartialEq < U > ,
78{
89 #[ inline]
910 fn eq ( & self , other : & [ U ; N ] ) -> bool {
1617}
1718
1819#[ stable( feature = "rust1" , since = "1.0.0" ) ]
19- impl < T , U , const N : usize > PartialEq < [ U ] > for [ T ; N ]
20+ #[ rustc_const_unstable( feature = "const_cmp" , issue = "143800" ) ]
21+ impl < T , U , const N : usize > const PartialEq < [ U ] > for [ T ; N ]
2022where
21- T : PartialEq < U > ,
23+ T : ~ const PartialEq < U > ,
2224{
2325 #[ inline]
2426 fn eq ( & self , other : & [ U ] ) -> bool {
3941}
4042
4143#[ stable( feature = "rust1" , since = "1.0.0" ) ]
42- impl < T , U , const N : usize > PartialEq < [ U ; N ] > for [ T ]
44+ #[ rustc_const_unstable( feature = "const_cmp" , issue = "143800" ) ]
45+ impl < T , U , const N : usize > const PartialEq < [ U ; N ] > for [ T ]
4346where
44- T : PartialEq < U > ,
47+ T : ~ const PartialEq < U > ,
4548{
4649 #[ inline]
4750 fn eq ( & self , other : & [ U ; N ] ) -> bool {
6265}
6366
6467#[ stable( feature = "rust1" , since = "1.0.0" ) ]
65- impl < T , U , const N : usize > PartialEq < & [ U ] > for [ T ; N ]
68+ #[ rustc_const_unstable( feature = "const_cmp" , issue = "143800" ) ]
69+ impl < T , U , const N : usize > const PartialEq < & [ U ] > for [ T ; N ]
6670where
67- T : PartialEq < U > ,
71+ T : ~ const PartialEq < U > ,
6872{
6973 #[ inline]
7074 fn eq ( & self , other : & & [ U ] ) -> bool {
7781}
7882
7983#[ stable( feature = "rust1" , since = "1.0.0" ) ]
80- impl < T , U , const N : usize > PartialEq < [ U ; N ] > for & [ T ]
84+ #[ rustc_const_unstable( feature = "const_cmp" , issue = "143800" ) ]
85+ impl < T , U , const N : usize > const PartialEq < [ U ; N ] > for & [ T ]
8186where
82- T : PartialEq < U > ,
87+ T : ~ const PartialEq < U > ,
8388{
8489 #[ inline]
8590 fn eq ( & self , other : & [ U ; N ] ) -> bool {
9297}
9398
9499#[ stable( feature = "rust1" , since = "1.0.0" ) ]
95- impl < T , U , const N : usize > PartialEq < & mut [ U ] > for [ T ; N ]
100+ #[ rustc_const_unstable( feature = "const_cmp" , issue = "143800" ) ]
101+ impl < T , U , const N : usize > const PartialEq < & mut [ U ] > for [ T ; N ]
96102where
97- T : PartialEq < U > ,
103+ T : ~ const PartialEq < U > ,
98104{
99105 #[ inline]
100106 fn eq ( & self , other : & & mut [ U ] ) -> bool {
@@ -107,9 +113,10 @@ where
107113}
108114
109115#[ stable( feature = "rust1" , since = "1.0.0" ) ]
110- impl < T , U , const N : usize > PartialEq < [ U ; N ] > for & mut [ T ]
116+ #[ rustc_const_unstable( feature = "const_cmp" , issue = "143800" ) ]
117+ impl < T , U , const N : usize > const PartialEq < [ U ; N ] > for & mut [ T ]
111118where
112- T : PartialEq < U > ,
119+ T : ~ const PartialEq < U > ,
113120{
114121 #[ inline]
115122 fn eq ( & self , other : & [ U ; N ] ) -> bool {
@@ -126,14 +133,18 @@ where
126133// __impl_slice_eq2! { [A; $N], &'b mut [B; $N] }
127134
128135#[ stable( feature = "rust1" , since = "1.0.0" ) ]
129- impl < T : Eq , const N : usize > Eq for [ T ; N ] { }
136+ #[ rustc_const_unstable( feature = "const_cmp" , issue = "143800" ) ]
137+ impl < T : ~const Eq , const N : usize > const Eq for [ T ; N ] { }
130138
139+ #[ const_trait]
140+ #[ rustc_const_unstable( feature = "const_cmp" , issue = "143800" ) ]
131141trait SpecArrayEq < Other , const N : usize > : Sized {
132142 fn spec_eq ( a : & [ Self ; N ] , b : & [ Other ; N ] ) -> bool ;
133143 fn spec_ne ( a : & [ Self ; N ] , b : & [ Other ; N ] ) -> bool ;
134144}
135145
136- impl < T : PartialEq < Other > , Other , const N : usize > SpecArrayEq < Other , N > for T {
146+ #[ rustc_const_unstable( feature = "const_cmp" , issue = "143800" ) ]
147+ impl < T : ~const PartialEq < Other > , Other , const N : usize > const SpecArrayEq < Other , N > for T {
137148 default fn spec_eq ( a : & [ Self ; N ] , b : & [ Other ; N ] ) -> bool {
138149 a[ ..] == b[ ..]
139150 }
@@ -142,7 +153,8 @@ impl<T: PartialEq<Other>, Other, const N: usize> SpecArrayEq<Other, N> for T {
142153 }
143154}
144155
145- impl < T : BytewiseEq < U > , U , const N : usize > SpecArrayEq < U , N > for T {
156+ #[ rustc_const_unstable( feature = "const_cmp" , issue = "143800" ) ]
157+ impl < T : ~const BytewiseEq < U > , U , const N : usize > const SpecArrayEq < U , N > for T {
146158 fn spec_eq ( a : & [ T ; N ] , b : & [ U ; N ] ) -> bool {
147159 // SAFETY: Arrays are compared element-wise, and don't add any padding
148160 // between elements, so when the elements are `BytewiseEq`, we can
0 commit comments