@@ -204,30 +204,35 @@ fn cmp_default() {
204
204
assert_eq ! ( Fool ( false ) , Fool ( true ) ) ;
205
205
}
206
206
207
- struct S ( i32 ) ;
207
+ #[ cfg( not( bootstrap) ) ]
208
+ mod const_cmp {
209
+ use super :: * ;
208
210
209
- impl const PartialEq for S {
210
- fn eq ( & self , other : & Self ) -> bool {
211
- self . 0 == other. 0
211
+ struct S ( i32 ) ;
212
+
213
+ impl const PartialEq for S {
214
+ fn eq ( & self , other : & Self ) -> bool {
215
+ self . 0 == other. 0
216
+ }
212
217
}
213
- }
214
218
215
- impl const PartialOrd for S {
216
- fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
217
- let ret = match ( self . 0 , other. 0 ) {
218
- ( a, b) if a > b => Ordering :: Greater ,
219
- ( a, b) if a < b => Ordering :: Less ,
220
- _ => Ordering :: Equal ,
221
- } ;
219
+ impl const PartialOrd for S {
220
+ fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
221
+ let ret = match ( self . 0 , other. 0 ) {
222
+ ( a, b) if a > b => Ordering :: Greater ,
223
+ ( a, b) if a < b => Ordering :: Less ,
224
+ _ => Ordering :: Equal ,
225
+ } ;
222
226
223
- Some ( ret)
227
+ Some ( ret)
228
+ }
224
229
}
225
- }
226
230
227
- const _: ( ) = assert ! ( S ( 1 ) == S ( 1 ) ) ;
228
- const _: ( ) = assert ! ( S ( 0 ) != S ( 1 ) ) ;
231
+ const _: ( ) = assert ! ( S ( 1 ) == S ( 1 ) ) ;
232
+ const _: ( ) = assert ! ( S ( 0 ) != S ( 1 ) ) ;
229
233
230
- const _: ( ) = assert ! ( S ( 1 ) <= S ( 1 ) ) ;
231
- const _: ( ) = assert ! ( S ( 1 ) >= S ( 1 ) ) ;
232
- const _: ( ) = assert ! ( S ( 0 ) < S ( 1 ) ) ;
233
- const _: ( ) = assert ! ( S ( 1 ) > S ( 0 ) ) ;
234
+ const _: ( ) = assert ! ( S ( 1 ) <= S ( 1 ) ) ;
235
+ const _: ( ) = assert ! ( S ( 1 ) >= S ( 1 ) ) ;
236
+ const _: ( ) = assert ! ( S ( 0 ) < S ( 1 ) ) ;
237
+ const _: ( ) = assert ! ( S ( 1 ) > S ( 0 ) ) ;
238
+ }
0 commit comments