@@ -45,16 +45,23 @@ fn struct_() -> Result<()> {
4545 }
4646 }
4747
48- #[ automatically_derived]
49- impl <T > :: core:: cmp:: Eq for Test <T > {
50- #[ inline]
51- fn assert_receiver_is_total_eq( & self ) {
52- struct __AssertEq<__T: :: core:: cmp:: Eq + ?:: core:: marker:: Sized >( :: core:: marker:: PhantomData <__T>) ;
48+ const _: ( ) = {
49+ trait DeriveWhereAssertEq {
50+ fn assert( & self ) ;
51+ }
5352
54- // For some reason the comparison fails without the extra space at the end.
55- let _: __AssertEq<std:: marker:: PhantomData <T > >;
53+ impl <T > DeriveWhereAssertEq for Test <T > {
54+ fn assert( & self ) {
55+ struct __AssertEq<__T: :: core:: cmp:: Eq + ?:: core:: marker:: Sized >( :: core:: marker:: PhantomData <__T>) ;
56+
57+ // For some reason the comparison fails without the extra space at the end.
58+ let _: __AssertEq<std:: marker:: PhantomData <T > >;
59+ }
5660 }
57- }
61+ } ;
62+
63+ #[ automatically_derived]
64+ impl <T > :: core:: cmp:: Eq for Test <T > { }
5865
5966 #[ automatically_derived]
6067 impl <T > :: core:: hash:: Hash for Test <T > {
@@ -141,16 +148,23 @@ fn tuple() -> Result<()> {
141148 }
142149 }
143150
144- #[ automatically_derived]
145- impl <T > :: core:: cmp:: Eq for Test <T > {
146- #[ inline]
147- fn assert_receiver_is_total_eq( & self ) {
148- struct __AssertEq<__T: :: core:: cmp:: Eq + ?:: core:: marker:: Sized >( :: core:: marker:: PhantomData <__T>) ;
151+ const _: ( ) = {
152+ trait DeriveWhereAssertEq {
153+ fn assert( & self ) ;
154+ }
155+
156+ impl <T > DeriveWhereAssertEq for Test <T > {
157+ fn assert( & self ) {
158+ struct __AssertEq<__T: :: core:: cmp:: Eq + ?:: core:: marker:: Sized >( :: core:: marker:: PhantomData <__T>) ;
149159
150- // For some reason the comparison fails without the extra space at the end.
151- let _: __AssertEq<std:: marker:: PhantomData <T > >;
160+ // For some reason the comparison fails without the extra space at the end.
161+ let _: __AssertEq<std:: marker:: PhantomData <T > >;
162+ }
152163 }
153- }
164+ } ;
165+
166+ #[ automatically_derived]
167+ impl <T > :: core:: cmp:: Eq for Test <T > { }
154168
155169 #[ automatically_derived]
156170 impl <T > :: core:: hash:: Hash for Test <T > {
@@ -287,17 +301,24 @@ fn enum_() -> Result<()> {
287301 }
288302 }
289303
290- #[ automatically_derived]
291- impl <T > :: core:: cmp:: Eq for Test <T > {
292- #[ inline]
293- fn assert_receiver_is_total_eq( & self ) {
294- struct __AssertEq<__T: :: core:: cmp:: Eq + ?:: core:: marker:: Sized >( :: core:: marker:: PhantomData <__T>) ;
304+ const _: ( ) = {
305+ trait DeriveWhereAssertEq {
306+ fn assert( & self ) ;
307+ }
308+
309+ impl <T > DeriveWhereAssertEq for Test <T > {
310+ fn assert( & self ) {
311+ struct __AssertEq<__T: :: core:: cmp:: Eq + ?:: core:: marker:: Sized >( :: core:: marker:: PhantomData <__T>) ;
295312
296- // For some reason the comparison fails without the extra space at the end.
297- let _: __AssertEq<std:: marker:: PhantomData <T > >;
298- let _: __AssertEq<std:: marker:: PhantomData <T > >;
313+ // For some reason the comparison fails without the extra space at the end.
314+ let _: __AssertEq<std:: marker:: PhantomData <T > >;
315+ let _: __AssertEq<std:: marker:: PhantomData <T > >;
316+ }
299317 }
300- }
318+ } ;
319+
320+ #[ automatically_derived]
321+ impl <T > :: core:: cmp:: Eq for Test <T > { }
301322
302323 #[ automatically_derived]
303324 impl <T > :: core:: hash:: Hash for Test <T > {
0 commit comments