@@ -15,9 +15,9 @@ pub struct X {
1515impl std:: cmp:: Ord for X {
1616 fn cmp ( & self , other : & Self ) -> std:: cmp:: Ordering {
1717 {
18- if operator_lt_0 ( self . clone ( ) , other. clone ( ) ) {
18+ if ( ( operator_lt_0 ( self . clone ( ) , other. clone ( ) ) ) != 0 ) {
1919 std:: cmp:: Ordering :: Less
20- } else if operator_lt_0 ( other. clone ( ) , self . clone ( ) ) {
20+ } else if ( ( operator_lt_0 ( other. clone ( ) , self . clone ( ) ) ) != 0 ) {
2121 std:: cmp:: Ordering :: Greater
2222 } else {
2323 std:: cmp:: Ordering :: Equal
@@ -32,7 +32,7 @@ impl std::cmp::PartialOrd for X {
3232}
3333impl std:: cmp:: PartialEq for X {
3434 fn eq ( & self , other : & Self ) -> bool {
35- { operator_eq_1 ( self . clone ( ) , other. clone ( ) ) }
35+ { ( ( operator_eq_1 ( self . clone ( ) , other. clone ( ) ) ) != 0 ) }
3636 }
3737}
3838impl std:: cmp:: Eq for X { }
@@ -66,32 +66,6 @@ pub struct Custom {
6666 #[ offset( 0 ) ]
6767 pub v : i32 ,
6868}
69- impl std:: cmp:: Ord for Custom {
70- fn cmp ( & self , other : & Self ) -> std:: cmp:: Ordering {
71- {
72- CustomImpl :: operator_cmp (
73- & Rc :: new ( RefCell :: new ( Custom { v : self . v . clone ( ) } ) ) . as_pointer ( ) ,
74- Rc :: new ( RefCell :: new ( Custom { v : other. v . clone ( ) } ) ) . as_pointer ( ) ,
75- )
76- }
77- }
78- }
79- impl std:: cmp:: PartialOrd for Custom {
80- fn partial_cmp ( & self , other : & Self ) -> Option < std:: cmp:: Ordering > {
81- Some ( self . cmp ( other) )
82- }
83- }
84- impl std:: cmp:: PartialEq for Custom {
85- fn eq ( & self , other : & Self ) -> bool {
86- {
87- CustomImpl :: operator_cmp (
88- & Rc :: new ( RefCell :: new ( Custom { v : self . v . clone ( ) } ) ) . as_pointer ( ) ,
89- Rc :: new ( RefCell :: new ( Custom { v : other. v . clone ( ) } ) ) . as_pointer ( ) ,
90- ) == std:: cmp:: Ordering :: Equal
91- }
92- }
93- }
94- impl std:: cmp:: Eq for Custom { }
9569#[ derive( Clone , Record , ByteRepr , VaArg , FnPtrArg , Default ) ]
9670#[ byte_size( 4 ) ]
9771pub struct Mixed {
@@ -101,10 +75,21 @@ pub struct Mixed {
10175impl std:: cmp:: Ord for Mixed {
10276 fn cmp ( & self , other : & Self ) -> std:: cmp:: Ordering {
10377 {
104- MixedImpl :: operator_cmp (
78+ if ( ( MixedImpl :: operator_lt (
10579 & Rc :: new ( RefCell :: new ( Mixed { v : self . v . clone ( ) } ) ) . as_pointer ( ) ,
10680 Rc :: new ( RefCell :: new ( Mixed { v : other. v . clone ( ) } ) ) . as_pointer ( ) ,
107- )
81+ ) ) != 0 )
82+ {
83+ std:: cmp:: Ordering :: Less
84+ } else if ( ( MixedImpl :: operator_lt (
85+ & Rc :: new ( RefCell :: new ( Mixed { v : other. v . clone ( ) } ) ) . as_pointer ( ) ,
86+ Rc :: new ( RefCell :: new ( Mixed { v : self . v . clone ( ) } ) ) . as_pointer ( ) ,
87+ ) ) != 0 )
88+ {
89+ std:: cmp:: Ordering :: Greater
90+ } else {
91+ std:: cmp:: Ordering :: Equal
92+ }
10893 }
10994 }
11095}
@@ -116,10 +101,10 @@ impl std::cmp::PartialOrd for Mixed {
116101impl std:: cmp:: PartialEq for Mixed {
117102 fn eq ( & self , other : & Self ) -> bool {
118103 {
119- MixedImpl :: operator_eq (
104+ ( ( MixedImpl :: operator_eq (
120105 & Rc :: new ( RefCell :: new ( Mixed { v : self . v . clone ( ) } ) ) . as_pointer ( ) ,
121106 Rc :: new ( RefCell :: new ( Mixed { v : other. v . clone ( ) } ) ) . as_pointer ( ) ,
122- )
107+ ) ) != 0 )
123108 }
124109 }
125110}
@@ -144,9 +129,25 @@ pub struct Boolish {
144129impl std:: cmp:: Ord for Boolish {
145130 fn cmp ( & self , other : & Self ) -> std:: cmp:: Ordering {
146131 {
147- if operator_lt_6 ( self . clone ( ) , other. clone ( ) ) {
132+ if {
133+ let __cmp = & operator_lt_6 ( self . clone ( ) , other. clone ( ) ) ;
134+ MyBoolImpl :: to_bool (
135+ & Rc :: new ( RefCell :: new ( MyBool {
136+ value : __cmp. value . clone ( ) ,
137+ } ) )
138+ . as_pointer ( ) ,
139+ )
140+ } {
148141 std:: cmp:: Ordering :: Less
149- } else if operator_lt_6 ( other. clone ( ) , self . clone ( ) ) {
142+ } else if {
143+ let __cmp = & operator_lt_6 ( other. clone ( ) , self . clone ( ) ) ;
144+ MyBoolImpl :: to_bool (
145+ & Rc :: new ( RefCell :: new ( MyBool {
146+ value : __cmp. value . clone ( ) ,
147+ } ) )
148+ . as_pointer ( ) ,
149+ )
150+ } {
150151 std:: cmp:: Ordering :: Greater
151152 } else {
152153 std:: cmp:: Ordering :: Equal
@@ -161,7 +162,17 @@ impl std::cmp::PartialOrd for Boolish {
161162}
162163impl std:: cmp:: PartialEq for Boolish {
163164 fn eq ( & self , other : & Self ) -> bool {
164- { operator_eq_7 ( self . clone ( ) , other. clone ( ) ) }
165+ {
166+ {
167+ let __cmp = & operator_eq_7 ( self . clone ( ) , other. clone ( ) ) ;
168+ MyBoolImpl :: to_bool (
169+ & Rc :: new ( RefCell :: new ( MyBool {
170+ value : __cmp. value . clone ( ) ,
171+ } ) )
172+ . as_pointer ( ) ,
173+ )
174+ }
175+ }
165176 }
166177}
167178impl std:: cmp:: Eq for Boolish { }
0 commit comments