about summary refs log tree commit diff
path: root/src/libcore/managed.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore/managed.rs')
-rw-r--r--src/libcore/managed.rs36
1 files changed, 28 insertions, 8 deletions
diff --git a/src/libcore/managed.rs b/src/libcore/managed.rs
index 1bef895ea0b..b177dced888 100644
--- a/src/libcore/managed.rs
+++ b/src/libcore/managed.rs
@@ -49,23 +49,43 @@ pub pure fn mut_ptr_eq<T>(a: @mut T, b: @mut T) -> bool {
 }
 
 #[cfg(notest)]
-impl<T:Eq> Eq for @const T {
+impl<T:Eq> Eq for @T {
     #[inline(always)]
-    pure fn eq(&self, other: &@const T) -> bool { *(*self) == *(*other) }
+    pure fn eq(&self, other: &@T) -> bool { *(*self) == *(*other) }
     #[inline(always)]
-    pure fn ne(&self, other: &@const T) -> bool { *(*self) != *(*other) }
+    pure fn ne(&self, other: &@T) -> bool { *(*self) != *(*other) }
 }
 
 #[cfg(notest)]
-impl<T:Ord> Ord for @const T {
+impl<T:Eq> Eq for @mut T {
     #[inline(always)]
-    pure fn lt(&self, other: &@const T) -> bool { *(*self) < *(*other) }
+    pure fn eq(&self, other: &@mut T) -> bool { *(*self) == *(*other) }
     #[inline(always)]
-    pure fn le(&self, other: &@const T) -> bool { *(*self) <= *(*other) }
+    pure fn ne(&self, other: &@mut T) -> bool { *(*self) != *(*other) }
+}
+
+#[cfg(notest)]
+impl<T:Ord> Ord for @T {
+    #[inline(always)]
+    pure fn lt(&self, other: &@T) -> bool { *(*self) < *(*other) }
+    #[inline(always)]
+    pure fn le(&self, other: &@T) -> bool { *(*self) <= *(*other) }
+    #[inline(always)]
+    pure fn ge(&self, other: &@T) -> bool { *(*self) >= *(*other) }
+    #[inline(always)]
+    pure fn gt(&self, other: &@T) -> bool { *(*self) > *(*other) }
+}
+
+#[cfg(notest)]
+impl<T:Ord> Ord for @mut T {
+    #[inline(always)]
+    pure fn lt(&self, other: &@mut T) -> bool { *(*self) < *(*other) }
+    #[inline(always)]
+    pure fn le(&self, other: &@mut T) -> bool { *(*self) <= *(*other) }
     #[inline(always)]
-    pure fn ge(&self, other: &@const T) -> bool { *(*self) >= *(*other) }
+    pure fn ge(&self, other: &@mut T) -> bool { *(*self) >= *(*other) }
     #[inline(always)]
-    pure fn gt(&self, other: &@const T) -> bool { *(*self) > *(*other) }
+    pure fn gt(&self, other: &@mut T) -> bool { *(*self) > *(*other) }
 }
 
 #[test]