diff --git a/src/libextra/treemap.rs b/src/libextra/treemap.rs index 5a8cd94c9e9a7..8f1bd3a9df1a0 100644 --- a/src/libextra/treemap.rs +++ b/src/libextra/treemap.rs @@ -549,6 +549,7 @@ impl<'a, T> Iterator<&'a T> for TreeSetRevIterator<'a, T> { /// A implementation of the `Set` trait on top of the `TreeMap` container. The /// only requirement is that the type of the elements contained ascribes to the /// `TotalOrd` trait. +#[deriving(Clone)] pub struct TreeSet { priv map: TreeMap } @@ -1588,6 +1589,16 @@ mod test_set { } } + #[test] + fn test_clone_eq() { + let mut m = TreeSet::new(); + + m.insert(1); + m.insert(2); + + assert!(m.clone() == m); + } + fn check(a: &[int], b: &[int], expected: &[int],