mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-04 02:54:00 +00:00
auto merge of #11510 : wycats/rust/clone-treeset, r=huonw
This commit is contained in:
commit
caf316a31e
@ -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<T> {
|
||||
priv map: TreeMap<T, ()>
|
||||
}
|
||||
@ -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],
|
||||
|
Loading…
Reference in New Issue
Block a user