@@ -383,7 +383,7 @@ impl<T> RawPtr<T> for *mut T {
383383}
384384
385385// Equality for pointers
386- #[ cfg( not( test) ) ]
386+ #[ cfg( stage0 , not( test) ) ]
387387impl < T > Eq for * T {
388388 #[ inline]
389389 fn eq ( & self , other : & * T ) -> bool {
@@ -393,7 +393,17 @@ impl<T> Eq for *T {
393393 fn ne ( & self , other : & * T ) -> bool { !self . eq ( other) }
394394}
395395
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) ) ]
397407impl < T > Eq for * mut T {
398408 #[ inline]
399409 fn eq ( & self , other : & * mut T ) -> bool {
@@ -403,6 +413,16 @@ impl<T> Eq for *mut T {
403413 fn ne ( & self , other : & * mut T ) -> bool { !self . eq ( other) }
404414}
405415
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+
406426// Equivalence for pointers
407427#[ cfg( not( test) ) ]
408428impl < T > Equiv < * mut T > for * T {
@@ -460,7 +480,7 @@ mod externfnpointers {
460480}
461481
462482// Comparison for pointers
463- #[ cfg( not( test) ) ]
483+ #[ cfg( stage0 , not( test) ) ]
464484impl < T > Ord for * T {
465485 #[ inline]
466486 fn lt ( & self , other : & * T ) -> bool {
@@ -480,7 +500,27 @@ impl<T> Ord for *T {
480500 }
481501}
482502
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) ) ]
484524impl < T > Ord for * mut T {
485525 #[ inline]
486526 fn lt ( & self , other : & * mut T ) -> bool {
@@ -500,6 +540,26 @@ impl<T> Ord for *mut T {
500540 }
501541}
502542
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+
503563#[ cfg( test) ]
504564pub mod ptr_tests {
505565 use super :: * ;
0 commit comments