File tree 3 files changed +49
-2
lines changed
3 files changed +49
-2
lines changed Original file line number Diff line number Diff line change @@ -58,3 +58,15 @@ impl<'self, T: Ord> Ord for &'self T {
58
58
* ( * self ) > * ( * other)
59
59
}
60
60
}
61
+
62
+ #[ cfg( not( test) ) ]
63
+ impl < ' self , T : TotalOrd > TotalOrd for & ' self T {
64
+ #[ inline]
65
+ fn cmp ( & self , other : & & ' self T ) -> Ordering { ( * * self ) . cmp ( * other) }
66
+ }
67
+
68
+ #[ cfg( not( test) ) ]
69
+ impl < ' self , T : TotalEq > TotalEq for & ' self T {
70
+ #[ inline]
71
+ fn equals ( & self , other : & & ' self T ) -> bool { ( * * self ) . equals ( * other) }
72
+ }
Original file line number Diff line number Diff line change 12
12
13
13
use ptr:: to_unsafe_ptr;
14
14
15
- #[ cfg( not( test) ) ] use cmp:: { Eq , Ord } ;
15
+ #[ cfg( not( test) ) ] use cmp:: * ;
16
16
17
17
pub static RC_MANAGED_UNIQUE : uint = ( -2 ) as uint ;
18
18
pub static RC_IMMORTAL : uint = 0x77777777 ;
@@ -71,6 +71,29 @@ impl<T:Ord> Ord for @mut T {
71
71
fn gt ( & self , other : & @mut T ) -> bool { * ( * self ) > * ( * other) }
72
72
}
73
73
74
+ #[ cfg( not( test) ) ]
75
+ impl < T : TotalOrd > TotalOrd for @T {
76
+ #[ inline]
77
+ fn cmp ( & self , other : & @T ) -> Ordering { ( * * self ) . cmp ( * other) }
78
+ }
79
+
80
+ #[ cfg( not( test) ) ]
81
+ impl < T : TotalOrd > TotalOrd for @mut T {
82
+ #[ inline]
83
+ fn cmp ( & self , other : & @mut T ) -> Ordering { ( * * self ) . cmp ( * other) }
84
+ }
85
+
86
+ #[ cfg( not( test) ) ]
87
+ impl < T : TotalEq > TotalEq for @T {
88
+ #[ inline]
89
+ fn equals ( & self , other : & @T ) -> bool { ( * * self ) . equals ( * other) }
90
+ }
91
+
92
+ #[ cfg( not( test) ) ]
93
+ impl < T : TotalEq > TotalEq for @mut T {
94
+ #[ inline]
95
+ fn equals ( & self , other : & @mut T ) -> bool { ( * * self ) . equals ( * other) }
96
+ }
74
97
#[ test]
75
98
fn test ( ) {
76
99
let x = @3 ;
Original file line number Diff line number Diff line change 10
10
11
11
//! Operations on unique pointer types
12
12
13
- #[ cfg( not( test) ) ] use cmp:: { Eq , Ord } ;
13
+ #[ cfg( not( test) ) ] use cmp:: * ;
14
14
15
15
#[ cfg( not( test) ) ]
16
16
impl < T : Eq > Eq for ~T {
@@ -31,3 +31,15 @@ impl<T:Ord> Ord for ~T {
31
31
#[ inline]
32
32
fn gt ( & self , other : & ~T ) -> bool { * ( * self ) > * ( * other) }
33
33
}
34
+
35
+ #[ cfg( not( test) ) ]
36
+ impl < T : TotalOrd > TotalOrd for ~T {
37
+ #[ inline]
38
+ fn cmp ( & self , other : & ~T ) -> Ordering { ( * * self ) . cmp ( * other) }
39
+ }
40
+
41
+ #[ cfg( not( test) ) ]
42
+ impl < T : TotalEq > TotalEq for ~T {
43
+ #[ inline]
44
+ fn equals ( & self , other : & ~T ) -> bool { ( * * self ) . equals ( * other) }
45
+ }
You can’t perform that action at this time.
0 commit comments