@@ -383,7 +383,7 @@ impl<T> RawPtr<T> for *mut T {
383
383
}
384
384
385
385
// Equality for pointers
386
- #[ cfg( not( test) ) ]
386
+ #[ cfg( stage0 , not( test) ) ]
387
387
impl < T > Eq for * T {
388
388
#[ inline]
389
389
fn eq ( & self , other : & * T ) -> bool {
@@ -393,7 +393,17 @@ impl<T> Eq for *T {
393
393
fn ne ( & self , other : & * T ) -> bool { !self . eq ( other) }
394
394
}
395
395
396
- #[ cfg( not( test) ) ]
396
+ #[ cfg( not( stage0) , not( test) ) ]
397
+ impl < T > Eq for * T {
398
+ #[ inline]
399
+ fn eq ( & self , other : & * T ) -> bool {
400
+ * self == * other
401
+ }
402
+ #[ inline]
403
+ fn ne ( & self , other : & * T ) -> bool { !self . eq ( other) }
404
+ }
405
+
406
+ #[ cfg( stage0, not( test) ) ]
397
407
impl < T > Eq for * mut T {
398
408
#[ inline]
399
409
fn eq ( & self , other : & * mut T ) -> bool {
@@ -403,6 +413,16 @@ impl<T> Eq for *mut T {
403
413
fn ne ( & self , other : & * mut T ) -> bool { !self . eq ( other) }
404
414
}
405
415
416
+ #[ cfg( not( stage0) , not( test) ) ]
417
+ impl < T > Eq for * mut T {
418
+ #[ inline]
419
+ fn eq ( & self , other : & * mut T ) -> bool {
420
+ * self == * other
421
+ }
422
+ #[ inline]
423
+ fn ne ( & self , other : & * mut T ) -> bool { !self . eq ( other) }
424
+ }
425
+
406
426
// Equivalence for pointers
407
427
#[ cfg( not( test) ) ]
408
428
impl < T > Equiv < * mut T > for * T {
@@ -460,7 +480,7 @@ mod externfnpointers {
460
480
}
461
481
462
482
// Comparison for pointers
463
- #[ cfg( not( test) ) ]
483
+ #[ cfg( stage0 , not( test) ) ]
464
484
impl < T > Ord for * T {
465
485
#[ inline]
466
486
fn lt ( & self , other : & * T ) -> bool {
@@ -480,7 +500,27 @@ impl<T> Ord for *T {
480
500
}
481
501
}
482
502
483
- #[ cfg( not( test) ) ]
503
+ #[ cfg( not( stage0) , not( test) ) ]
504
+ impl < T > Ord for * T {
505
+ #[ inline]
506
+ fn lt ( & self , other : & * T ) -> bool {
507
+ * self < * other
508
+ }
509
+ #[ inline]
510
+ fn le ( & self , other : & * T ) -> bool {
511
+ * self <= * other
512
+ }
513
+ #[ inline]
514
+ fn ge ( & self , other : & * T ) -> bool {
515
+ * self >= * other
516
+ }
517
+ #[ inline]
518
+ fn gt ( & self , other : & * T ) -> bool {
519
+ * self > * other
520
+ }
521
+ }
522
+
523
+ #[ cfg( stage0, not( test) ) ]
484
524
impl < T > Ord for * mut T {
485
525
#[ inline]
486
526
fn lt ( & self , other : & * mut T ) -> bool {
@@ -500,6 +540,26 @@ impl<T> Ord for *mut T {
500
540
}
501
541
}
502
542
543
+ #[ cfg( not( stage0) , not( test) ) ]
544
+ impl < T > Ord for * mut T {
545
+ #[ inline]
546
+ fn lt ( & self , other : & * mut T ) -> bool {
547
+ * self < * other
548
+ }
549
+ #[ inline]
550
+ fn le ( & self , other : & * mut T ) -> bool {
551
+ * self <= * other
552
+ }
553
+ #[ inline]
554
+ fn ge ( & self , other : & * mut T ) -> bool {
555
+ * self >= * other
556
+ }
557
+ #[ inline]
558
+ fn gt ( & self , other : & * mut T ) -> bool {
559
+ * self > * other
560
+ }
561
+ }
562
+
503
563
#[ cfg( test) ]
504
564
pub mod ptr_tests {
505
565
use super :: * ;
0 commit comments