about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcollections/dlist.rs7
-rw-r--r--src/libcollections/ringbuf.rs7
-rw-r--r--src/libcollections/treemap.rs14
3 files changed, 28 insertions, 0 deletions
diff --git a/src/libcollections/dlist.rs b/src/libcollections/dlist.rs
index e3bae4dfa94..3d322729aab 100644
--- a/src/libcollections/dlist.rs
+++ b/src/libcollections/dlist.rs
@@ -691,6 +691,13 @@ impl<A: PartialOrd> PartialOrd for DList<A> {
     }
 }
 
+impl<A: Ord> Ord for DList<A> {
+    #[inline]
+    fn cmp(&self, other: &DList<A>) -> Ordering {
+        iter::order::cmp(self.iter(), other.iter())
+    }
+}
+
 impl<A: Clone> Clone for DList<A> {
     fn clone(&self) -> DList<A> {
         self.iter().map(|x| x.clone()).collect()
diff --git a/src/libcollections/ringbuf.rs b/src/libcollections/ringbuf.rs
index 1ce5b41ffb7..0cde7a90e9c 100644
--- a/src/libcollections/ringbuf.rs
+++ b/src/libcollections/ringbuf.rs
@@ -460,6 +460,13 @@ impl<A: PartialOrd> PartialOrd for RingBuf<A> {
     }
 }
 
+impl<A: Ord> Ord for RingBuf<A> {
+    #[inline]
+    fn cmp(&self, other: &RingBuf<A>) -> Ordering {
+        iter::order::cmp(self.iter(), other.iter())
+    }
+}
+
 impl<S: Writer, A: Hash<S>> Hash<S> for RingBuf<A> {
     fn hash(&self, state: &mut S) {
         self.len().hash(state);
diff --git a/src/libcollections/treemap.rs b/src/libcollections/treemap.rs
index 7a4fe0652cd..afb838333f3 100644
--- a/src/libcollections/treemap.rs
+++ b/src/libcollections/treemap.rs
@@ -182,6 +182,13 @@ impl<K: Ord, V: PartialOrd> PartialOrd for TreeMap<K, V> {
     }
 }
 
+impl<K: Ord, V: Ord> Ord for TreeMap<K, V> {
+    #[inline]
+    fn cmp(&self, other: &TreeMap<K, V>) -> Ordering {
+        iter::order::cmp(self.iter(), other.iter())
+    }
+}
+
 impl<K: Ord + Show, V: Show> Show for TreeMap<K, V> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         try!(write!(f, "{{"));
@@ -1021,6 +1028,13 @@ impl<T: Ord> PartialOrd for TreeSet<T> {
     }
 }
 
+impl<T: Ord> Ord for TreeSet<T> {
+    #[inline]
+    fn cmp(&self, other: &TreeSet<T>) -> Ordering {
+        iter::order::cmp(self.iter(), other.iter())
+    }
+}
+
 impl<T: Ord + Show> Show for TreeSet<T> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         try!(write!(f, "{{"));