92
92
93
93
use cast;
94
94
use clone:: Clone ;
95
- #[ cfg( not( test) ) ]
96
- use cmp:: Equiv ;
95
+ use intrinsics;
97
96
use iter:: { range, Iterator } ;
98
97
use mem;
99
- use option:: { Option , Some , None } ;
100
- use intrinsics;
98
+ use option:: { Some , None , Option } ;
101
99
102
- #[ cfg( not( test) ) ] use cmp:: { Eq , TotalEq , Ord } ;
100
+ #[ cfg( not( test) ) ] use cmp:: { Eq , TotalEq , Ord , Equiv } ;
103
101
104
102
/// Return the offset of the first null pointer in `buf`.
105
103
#[ inline]
@@ -377,7 +375,9 @@ impl<T> RawPtr<T> for *mut T {
377
375
fn to_uint ( & self ) -> uint { * self as uint }
378
376
379
377
#[ inline]
380
- unsafe fn offset ( self , count : int ) -> * mut T { intrinsics:: offset ( self as * T , count) as * mut T }
378
+ unsafe fn offset ( self , count : int ) -> * mut T {
379
+ intrinsics:: offset ( self as * T , count) as * mut T
380
+ }
381
381
382
382
#[ inline]
383
383
unsafe fn to_option ( & self ) -> Option < & T > {
@@ -444,10 +444,6 @@ mod externfnpointers {
444
444
let other_: * ( ) = unsafe { cast:: transmute ( * other) } ;
445
445
self_ == other_
446
446
}
447
- #[ inline]
448
- fn ne ( & self , other : & extern "C" fn ( ) -> _R ) -> bool {
449
- !self . eq ( other)
450
- }
451
447
}
452
448
macro_rules! fnptreq(
453
449
( $( $p: ident) ,* ) => {
@@ -458,10 +454,6 @@ mod externfnpointers {
458
454
let other_: * ( ) = unsafe { cast:: transmute( * other) } ;
459
455
self_ == other_
460
456
}
461
- #[ inline]
462
- fn ne( & self , other: & extern "C" fn ( $( $p) ,* ) -> _R) -> bool {
463
- !self . eq( other)
464
- }
465
457
}
466
458
}
467
459
)
@@ -476,41 +468,13 @@ mod externfnpointers {
476
468
#[ cfg( not( test) ) ]
477
469
impl < T > Ord for * T {
478
470
#[ inline]
479
- fn lt ( & self , other : & * T ) -> bool {
480
- * self < * other
481
- }
482
- #[ inline]
483
- fn le ( & self , other : & * T ) -> bool {
484
- * self <= * other
485
- }
486
- #[ inline]
487
- fn ge ( & self , other : & * T ) -> bool {
488
- * self >= * other
489
- }
490
- #[ inline]
491
- fn gt ( & self , other : & * T ) -> bool {
492
- * self > * other
493
- }
471
+ fn lt ( & self , other : & * T ) -> bool { * self < * other }
494
472
}
495
473
496
474
#[ cfg( not( test) ) ]
497
475
impl < T > Ord for * mut T {
498
476
#[ inline]
499
- fn lt ( & self , other : & * mut T ) -> bool {
500
- * self < * other
501
- }
502
- #[ inline]
503
- fn le ( & self , other : & * mut T ) -> bool {
504
- * self <= * other
505
- }
506
- #[ inline]
507
- fn ge ( & self , other : & * mut T ) -> bool {
508
- * self >= * other
509
- }
510
- #[ inline]
511
- fn gt ( & self , other : & * mut T ) -> bool {
512
- * self > * other
513
- }
477
+ fn lt ( & self , other : & * mut T ) -> bool { * self < * other }
514
478
}
515
479
516
480
#[ cfg( test) ]
0 commit comments