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 PartialOrd for DList { } } +impl Ord for DList { + #[inline] + fn cmp(&self, other: &DList) -> Ordering { + iter::order::cmp(self.iter(), other.iter()) + } +} + impl Clone for DList { fn clone(&self) -> DList { 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 PartialOrd for RingBuf { } } +impl Ord for RingBuf { + #[inline] + fn cmp(&self, other: &RingBuf) -> Ordering { + iter::order::cmp(self.iter(), other.iter()) + } +} + impl> Hash for RingBuf { 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 PartialOrd for TreeMap { } } +impl Ord for TreeMap { + #[inline] + fn cmp(&self, other: &TreeMap) -> Ordering { + iter::order::cmp(self.iter(), other.iter()) + } +} + impl Show for TreeMap { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { try!(write!(f, "{{")); @@ -1021,6 +1028,13 @@ impl PartialOrd for TreeSet { } } +impl Ord for TreeSet { + #[inline] + fn cmp(&self, other: &TreeSet) -> Ordering { + iter::order::cmp(self.iter(), other.iter()) + } +} + impl Show for TreeSet { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { try!(write!(f, "{{"));