Skip to content

Commit f1f9cb7

Browse files
committedFeb 1, 2015
Auto merge of #21809 - japaric:no-copy, r=alexcrichton
Removes `Copy` from `ops::Range` (`a..b`) and `ops::RangeFrom` (`a..`) [breaking-change] --- I forgot about these two in #20790, this PR also adds `Clone` to the `Peekable` adapter which used to be `Copy`able. r? @nikomatsakis or anyone
2 parents fe4340a + c3841b9 commit f1f9cb7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
 

‎src/libcore/iter.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1824,6 +1824,7 @@ impl<I> RandomAccessIterator for Enumerate<I> where I: RandomAccessIterator {
18241824
}
18251825

18261826
/// An iterator with a `peek()` that returns an optional reference to the next element.
1827+
#[derive(Clone)]
18271828
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
18281829
#[stable(feature = "rust1", since = "1.0.0")]
18291830
pub struct Peekable<T, I> where I: Iterator<Item=T> {

‎src/libcore/ops.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ impl fmt::Debug for RangeFull {
977977
}
978978

979979
/// A (half-open) range which is bounded at both ends.
980-
#[derive(Copy, Clone, PartialEq, Eq)]
980+
#[derive(Clone, PartialEq, Eq)]
981981
#[lang="range"]
982982
#[stable(feature = "rust1", since = "1.0.0")]
983983
pub struct Range<Idx> {
@@ -995,7 +995,7 @@ impl<Idx: fmt::Debug> fmt::Debug for Range<Idx> {
995995
}
996996

997997
/// A range which is only bounded below.
998-
#[derive(Copy, Clone, PartialEq, Eq)]
998+
#[derive(Clone, PartialEq, Eq)]
999999
#[lang="range_from"]
10001000
#[stable(feature = "rust1", since = "1.0.0")]
10011001
pub struct RangeFrom<Idx> {

0 commit comments

Comments
 (0)