about summary refs log tree commit diff
path: root/src/libcollections
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-04-02 07:19:33 +0000
committerbors <bors@rust-lang.org>2015-04-02 07:19:33 +0000
commitcf00fc4da984481a75229ce1e40f339f292d2166 (patch)
tree460e4d59504435411421cf261c5735a726f16942 /src/libcollections
parent2e3b0c051dca9880bf66b5366dccd2e0bb424b99 (diff)
parente3b7e6caa25bffcffe6b04f550f551e1ae086f6b (diff)
downloadrust-cf00fc4da984481a75229ce1e40f339f292d2166.tar.gz
rust-cf00fc4da984481a75229ce1e40f339f292d2166.zip
Auto merge of #23963 - alexcrichton:rollup, r=alexcrichton

Diffstat (limited to 'src/libcollections')
-rw-r--r--src/libcollections/binary_heap.rs2
-rw-r--r--src/libcollections/btree/node.rs2
-rw-r--r--src/libcollections/enum_set.rs6
-rw-r--r--src/libcollections/slice.rs2
4 files changed, 8 insertions, 4 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 {
diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs
index d35173cbebf..ff923fb1906 100644
--- a/src/libcollections/slice.rs
+++ b/src/libcollections/slice.rs
@@ -1135,7 +1135,7 @@ impl Iterator for ElementSwaps {
     // #[inline]
     fn next(&mut self) -> Option<(usize, usize)> {
         fn new_pos_wrapping(i: usize, s: Direction) -> usize {
-            i.wrapping_add(match s { Pos => 1, Neg => -1 })
+            i.wrapping_add(match s { Pos => 1, Neg => !0 /* aka -1 */ })
         }
 
         fn new_pos(i: usize, s: Direction) -> usize {