diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-04-01 18:37:54 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-04-01 18:37:54 -0700 |
| commit | f92e7abefd0231f80d16062e5ff6aaf8cc3bc861 (patch) | |
| tree | e8c5150252807a3b65c231c338627aaaef025f92 /src/libcollections | |
| parent | 05654e528d9835f5b994241970bb4b6162665750 (diff) | |
| parent | 449643301c1b30adf6b338174351219a58ffdb36 (diff) | |
| download | rust-f92e7abefd0231f80d16062e5ff6aaf8cc3bc861.tar.gz rust-f92e7abefd0231f80d16062e5ff6aaf8cc3bc861.zip | |
rollup merge of #23860: nikomatsakis/copy-requires-clone
Conflicts: src/test/compile-fail/coherence-impls-copy.rs
Diffstat (limited to 'src/libcollections')
| -rw-r--r-- | src/libcollections/binary_heap.rs | 2 | ||||
| -rw-r--r-- | src/libcollections/btree/node.rs | 2 | ||||
| -rw-r--r-- | src/libcollections/enum_set.rs | 6 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/libcollections/binary_heap.rs b/src/libcollections/binary_heap.rs index e4bc6a393c4..3804874a650 100644 --- a/src/libcollections/binary_heap.rs +++ b/src/libcollections/binary_heap.rs @@ -30,7 +30,7 @@ //! use std::collections::BinaryHeap; //! use std::usize; //! -//! #[derive(Copy, Eq, PartialEq)] +//! #[derive(Copy, Clone, Eq, PartialEq)] //! struct State { //! cost: usize, //! position: usize, diff --git a/src/libcollections/btree/node.rs b/src/libcollections/btree/node.rs index 847ee7c19ce..26c57256049 100644 --- a/src/libcollections/btree/node.rs +++ b/src/libcollections/btree/node.rs @@ -526,7 +526,7 @@ impl<K: Clone, V: Clone> Clone for Node<K, V> { /// println!("Uninitialized memory: {:?}", handle.into_kv()); /// } /// ``` -#[derive(Copy)] +#[derive(Copy, Clone)] pub struct Handle<NodeRef, Type, NodeType> { node: NodeRef, index: usize, diff --git a/src/libcollections/enum_set.rs b/src/libcollections/enum_set.rs index 474b4de8123..0b206d381dd 100644 --- a/src/libcollections/enum_set.rs +++ b/src/libcollections/enum_set.rs @@ -21,7 +21,7 @@ use core::ops::{Sub, BitOr, BitAnd, BitXor}; // FIXME(contentions): implement union family of methods? (general design may be wrong here) -#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(PartialEq, Eq, PartialOrd, Ord, Hash)] /// A specialized set implementation to use enum types. /// /// It is a logic error for an item to be modified in such a way that the transformation of the @@ -37,6 +37,10 @@ pub struct EnumSet<E> { impl<E> Copy for EnumSet<E> {} +impl<E> Clone for EnumSet<E> { + fn clone(&self) -> EnumSet<E> { *self } +} + #[stable(feature = "rust1", since = "1.0.0")] impl<E:CLike + fmt::Debug> fmt::Debug for EnumSet<E> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { |
