Skip to content

Commit 1a5da55

Browse files
committed
---
yaml --- r: 191446 b: refs/heads/try c: 30718dd h: refs/heads/master v: v3
1 parent 4007e25 commit 1a5da55

File tree

17 files changed

+406
-62
lines changed

17 files changed

+406
-62
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 809a554fca2d0ebc2ba50077016fe282a4064752
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c64d671671aea2e44ee7fc6eb00ee75fc30ed7b9
5-
refs/heads/try: da96d22d3a8bd4ad74e797b823dd10a34d88991e
5+
refs/heads/try: 30718dd44be229a5c61648a4aed6711441ef7b6d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libcollectionstest/vec_deque.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ fn test_mut_rev_iter_wrap() {
360360
assert_eq!(d.pop_front(), Some(1));
361361
d.push_back(4);
362362

363-
assert_eq!(d.iter_mut().rev().cloned().collect::<Vec<_>>(),
363+
assert_eq!(d.iter_mut().rev().map(|x| *x).collect::<Vec<_>>(),
364364
vec![4, 3, 2]);
365365
}
366366

branches/try/src/libcore/iter.rs

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ use default::Default;
6565
use marker;
6666
use mem;
6767
use num::{ToPrimitive, Int};
68-
use ops::{Add, Deref, FnMut, RangeFrom};
68+
use ops::{Add, FnMut, RangeFrom};
6969
use option::Option;
7070
use option::Option::{Some, None};
7171
use marker::Sized;
@@ -976,12 +976,11 @@ pub trait IteratorExt: Iterator + Sized {
976976
(ts, us)
977977
}
978978

979-
/// Creates an iterator that clones the elements it yields. Useful for converting an
980-
/// Iterator<&T> to an Iterator<T>.
981-
#[unstable(feature = "core", reason = "recent addition")]
982-
fn cloned(self) -> Cloned<Self> where
983-
Self::Item: Deref,
984-
<Self::Item as Deref>::Target: Clone,
979+
/// Creates an iterator that clones the elements it yields. Useful for
980+
/// converting an Iterator<&T> to an Iterator<T>.
981+
#[stable(feature = "rust1", since = "1.0.0")]
982+
fn cloned<'a, T: 'a>(self) -> Cloned<Self>
983+
where Self: Iterator<Item=&'a T>, T: Clone
985984
{
986985
Cloned { it: self }
987986
}
@@ -1279,14 +1278,12 @@ pub struct Cloned<I> {
12791278
}
12801279

12811280
#[stable(feature = "rust1", since = "1.0.0")]
1282-
impl<I> Iterator for Cloned<I> where
1283-
I: Iterator,
1284-
I::Item: Deref,
1285-
<I::Item as Deref>::Target: Clone
1281+
impl<'a, I, T: 'a> Iterator for Cloned<I>
1282+
where I: Iterator<Item=&'a T>, T: Clone
12861283
{
1287-
type Item = <I::Item as Deref>::Target;
1284+
type Item = T;
12881285

1289-
fn next(&mut self) -> Option<<Self as Iterator>::Item> {
1286+
fn next(&mut self) -> Option<T> {
12901287
self.it.next().cloned()
12911288
}
12921289

@@ -1296,36 +1293,30 @@ impl<I> Iterator for Cloned<I> where
12961293
}
12971294

12981295
#[stable(feature = "rust1", since = "1.0.0")]
1299-
impl<I> DoubleEndedIterator for Cloned<I> where
1300-
I: DoubleEndedIterator,
1301-
I::Item: Deref,
1302-
<I::Item as Deref>::Target: Clone
1296+
impl<'a, I, T: 'a> DoubleEndedIterator for Cloned<I>
1297+
where I: DoubleEndedIterator<Item=&'a T>, T: Clone
13031298
{
1304-
fn next_back(&mut self) -> Option<<Self as Iterator>::Item> {
1299+
fn next_back(&mut self) -> Option<T> {
13051300
self.it.next_back().cloned()
13061301
}
13071302
}
13081303

13091304
#[stable(feature = "rust1", since = "1.0.0")]
1310-
impl<I> ExactSizeIterator for Cloned<I> where
1311-
I: ExactSizeIterator,
1312-
I::Item: Deref,
1313-
<I::Item as Deref>::Target: Clone
1305+
impl<'a, I, T: 'a> ExactSizeIterator for Cloned<I>
1306+
where I: ExactSizeIterator<Item=&'a T>, T: Clone
13141307
{}
13151308

13161309
#[unstable(feature = "core", reason = "trait is experimental")]
1317-
impl<I> RandomAccessIterator for Cloned<I> where
1318-
I: RandomAccessIterator,
1319-
I::Item: Deref,
1320-
<I::Item as Deref>::Target: Clone
1310+
impl<'a, I, T: 'a> RandomAccessIterator for Cloned<I>
1311+
where I: RandomAccessIterator<Item=&'a T>, T: Clone
13211312
{
13221313
#[inline]
13231314
fn indexable(&self) -> usize {
13241315
self.it.indexable()
13251316
}
13261317

13271318
#[inline]
1328-
fn idx(&mut self, index: usize) -> Option<<Self as Iterator>::Item> {
1319+
fn idx(&mut self, index: usize) -> Option<T> {
13291320
self.it.idx(index).cloned()
13301321
}
13311322
}

branches/try/src/libcore/result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ impl<T, E> Result<T, E> {
330330
/// Convert from `Result<T, E>` to `Option<E>`
331331
///
332332
/// Converts `self` into an `Option<E>`, consuming `self`,
333-
/// and discarding the value, if any.
333+
/// and discarding the success value, if any.
334334
///
335335
/// # Examples
336336
///

0 commit comments

Comments
 (0)