Skip to content

Commit 59035d9

Browse files
committed
---
yaml --- r: 162622 b: refs/heads/try c: 6faff24 h: refs/heads/master v: v3
1 parent 8ea4a2a commit 59035d9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+338
-150
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: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cafe2966770ff377aad6dd9fd808e68055587c58
5-
refs/heads/try: 67ba096cc30ec0f5fac8deec23d5557012e33d27
5+
refs/heads/try: 6faff24ec85744de092a7d7c2378370f65d623bb
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libcollections/binary_heap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,10 +585,10 @@ impl<T> DoubleEndedIterator<T> for MoveItems<T> {
585585
fn next_back(&mut self) -> Option<T> { self.iter.next_back() }
586586
}
587587

588-
impl<T> ExactSize<T> for MoveItems<T> {}
588+
impl<T> ExactSizeIterator<T> for MoveItems<T> {}
589589

590590
impl<T: Ord> FromIterator<T> for BinaryHeap<T> {
591-
fn from_iter<Iter: Iterator<T>>(mut iter: Iter) -> BinaryHeap<T> {
591+
fn from_iter<Iter: Iterator<T>>(iter: Iter) -> BinaryHeap<T> {
592592
let vec: Vec<T> = iter.collect();
593593
BinaryHeap::from_vec(vec)
594594
}

branches/try/src/libcollections/bit.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ use core::prelude::*;
6868
use core::cmp;
6969
use core::default::Default;
7070
use core::fmt;
71-
use core::iter::{Chain, Enumerate, Repeat, Skip, Take};
71+
use core::iter::{Chain, Enumerate, Repeat, Skip, Take, repeat};
7272
use core::iter;
7373
use core::num::Int;
7474
use core::slice;
@@ -88,11 +88,11 @@ fn match_words <'a,'b>(a: &'a Bitv, b: &'b Bitv) -> (MatchWords<'a>, MatchWords<
8888

8989
// have to uselessly pretend to pad the longer one for type matching
9090
if a_len < b_len {
91-
(a.mask_words(0).chain(Repeat::new(0u32).enumerate().take(b_len).skip(a_len)),
92-
b.mask_words(0).chain(Repeat::new(0u32).enumerate().take(0).skip(0)))
91+
(a.mask_words(0).chain(repeat(0u32).enumerate().take(b_len).skip(a_len)),
92+
b.mask_words(0).chain(repeat(0u32).enumerate().take(0).skip(0)))
9393
} else {
94-
(a.mask_words(0).chain(Repeat::new(0u32).enumerate().take(0).skip(0)),
95-
b.mask_words(0).chain(Repeat::new(0u32).enumerate().take(a_len).skip(b_len)))
94+
(a.mask_words(0).chain(repeat(0u32).enumerate().take(0).skip(0)),
95+
b.mask_words(0).chain(repeat(0u32).enumerate().take(a_len).skip(b_len)))
9696
}
9797
}
9898

@@ -943,7 +943,7 @@ impl<'a> DoubleEndedIterator<bool> for Bits<'a> {
943943
}
944944
}
945945

946-
impl<'a> ExactSize<bool> for Bits<'a> {}
946+
impl<'a> ExactSizeIterator<bool> for Bits<'a> {}
947947

948948
impl<'a> RandomAccessIterator<bool> for Bits<'a> {
949949
#[inline]

branches/try/src/libcollections/btree/map.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ impl<K, V, E, T: Traverse<E> + DoubleEndedIterator<TraversalItem<K, V, E>>>
863863
// Note that the design of these iterators permits an *arbitrary* initial pair of min and max,
864864
// making these arbitrary sub-range iterators. However the logic to construct these paths
865865
// efficiently is fairly involved, so this is a FIXME. The sub-range iterators also wouldn't be
866-
// able to accurately predict size, so those iterators can't implement ExactSize.
866+
// able to accurately predict size, so those iterators can't implement ExactSizeIterator.
867867
fn next(&mut self) -> Option<(K, V)> {
868868
loop {
869869
// We want the smallest element, so try to get the top of the left stack
@@ -963,7 +963,7 @@ impl<'a, K, V> Iterator<(&'a K, &'a V)> for Entries<'a, K, V> {
963963
impl<'a, K, V> DoubleEndedIterator<(&'a K, &'a V)> for Entries<'a, K, V> {
964964
fn next_back(&mut self) -> Option<(&'a K, &'a V)> { self.inner.next_back() }
965965
}
966-
impl<'a, K, V> ExactSize<(&'a K, &'a V)> for Entries<'a, K, V> {}
966+
impl<'a, K, V> ExactSizeIterator<(&'a K, &'a V)> for Entries<'a, K, V> {}
967967

968968

969969
impl<'a, K, V> Iterator<(&'a K, &'a mut V)> for MutEntries<'a, K, V> {
@@ -973,7 +973,7 @@ impl<'a, K, V> Iterator<(&'a K, &'a mut V)> for MutEntries<'a, K, V> {
973973
impl<'a, K, V> DoubleEndedIterator<(&'a K, &'a mut V)> for MutEntries<'a, K, V> {
974974
fn next_back(&mut self) -> Option<(&'a K, &'a mut V)> { self.inner.next_back() }
975975
}
976-
impl<'a, K, V> ExactSize<(&'a K, &'a mut V)> for MutEntries<'a, K, V> {}
976+
impl<'a, K, V> ExactSizeIterator<(&'a K, &'a mut V)> for MutEntries<'a, K, V> {}
977977

978978

979979
impl<K, V> Iterator<(K, V)> for MoveEntries<K, V> {
@@ -983,7 +983,7 @@ impl<K, V> Iterator<(K, V)> for MoveEntries<K, V> {
983983
impl<K, V> DoubleEndedIterator<(K, V)> for MoveEntries<K, V> {
984984
fn next_back(&mut self) -> Option<(K, V)> { self.inner.next_back() }
985985
}
986-
impl<K, V> ExactSize<(K, V)> for MoveEntries<K, V> {}
986+
impl<K, V> ExactSizeIterator<(K, V)> for MoveEntries<K, V> {}
987987

988988

989989

branches/try/src/libcollections/dlist.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ impl<'a, A> DoubleEndedIterator<&'a A> for Items<'a, A> {
607607
}
608608
}
609609

610-
impl<'a, A> ExactSize<&'a A> for Items<'a, A> {}
610+
impl<'a, A> ExactSizeIterator<&'a A> for Items<'a, A> {}
611611

612612
impl<'a, A> Iterator<&'a mut A> for MutItems<'a, A> {
613613
#[inline]
@@ -645,7 +645,7 @@ impl<'a, A> DoubleEndedIterator<&'a mut A> for MutItems<'a, A> {
645645
}
646646
}
647647

648-
impl<'a, A> ExactSize<&'a mut A> for MutItems<'a, A> {}
648+
impl<'a, A> ExactSizeIterator<&'a mut A> for MutItems<'a, A> {}
649649

650650
/// Allows mutating a `DList` while iterating.
651651
pub trait ListInsertion<A> {

branches/try/src/libcollections/ring_buf.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -695,8 +695,7 @@ impl<'a, T> DoubleEndedIterator<&'a T> for Items<'a, T> {
695695
}
696696
}
697697

698-
699-
impl<'a, T> ExactSize<&'a T> for Items<'a, T> {}
698+
impl<'a, T> ExactSizeIterator<&'a T> for Items<'a, T> {}
700699

701700
impl<'a, T> RandomAccessIterator<&'a T> for Items<'a, T> {
702701
#[inline]
@@ -763,7 +762,7 @@ impl<'a, T> DoubleEndedIterator<&'a mut T> for MutItems<'a, T> {
763762
}
764763
}
765764

766-
impl<'a, T> ExactSize<&'a mut T> for MutItems<'a, T> {}
765+
impl<'a, T> ExactSizeIterator<&'a mut T> for MutItems<'a, T> {}
767766

768767
impl<A: PartialEq> PartialEq for RingBuf<A> {
769768
fn eq(&self, other: &RingBuf<A>) -> bool {
@@ -1322,7 +1321,7 @@ mod tests {
13221321
let u: Vec<int> = deq.iter().map(|&x| x).collect();
13231322
assert_eq!(u, v);
13241323

1325-
let mut seq = iter::count(0u, 2).take(256);
1324+
let seq = iter::count(0u, 2).take(256);
13261325
let deq: RingBuf<uint> = seq.collect();
13271326
for (i, &x) in deq.iter().enumerate() {
13281327
assert_eq!(2*i, x);

branches/try/src/libcollections/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ use core::cmp;
9494
use core::kinds::Sized;
9595
use core::mem::size_of;
9696
use core::mem;
97-
use core::prelude::{Clone, Greater, Iterator, Less, None, Option};
97+
use core::prelude::{Clone, Greater, Iterator, IteratorExt, Less, None, Option};
9898
use core::prelude::{Ord, Ordering, RawPtr, Some, range};
9999
use core::ptr;
100100
use core::iter::{range_step, MultiplicativeIterator};

branches/try/src/libcollections/str.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ use core::cmp;
6161
use core::iter::AdditiveIterator;
6262
use core::kinds::Sized;
6363
use core::prelude::{Char, Clone, Eq, Equiv};
64-
use core::prelude::{Iterator, SlicePrelude, None, Option, Ord, Ordering};
64+
use core::prelude::{Iterator, IteratorExt, SlicePrelude, None, Option, Ord, Ordering};
6565
use core::prelude::{PartialEq, PartialOrd, Result, AsSlice, Some, Tuple2};
6666
use core::prelude::{range};
6767

@@ -828,7 +828,7 @@ mod tests {
828828
use std::cmp::{Equal, Greater, Less, Ord, PartialOrd, Equiv};
829829
use std::option::{Some, None};
830830
use std::ptr::RawPtr;
831-
use std::iter::{Iterator, DoubleEndedIterator};
831+
use std::iter::{Iterator, IteratorExt, DoubleEndedIteratorExt};
832832

833833
use super::*;
834834
use std::slice::{AsSlice, SlicePrelude};
@@ -2177,12 +2177,15 @@ mod tests {
21772177
let gr_inds = s.grapheme_indices(true).rev().collect::<Vec<(uint, &str)>>();
21782178
let b: &[_] = &[(11, "\r\n"), (6, "ö̲"), (3, "é"), (0u, "a̐")];
21792179
assert_eq!(gr_inds.as_slice(), b);
2180-
let mut gr_inds = s.grapheme_indices(true);
2181-
let e1 = gr_inds.size_hint();
2182-
assert_eq!(e1, (1, Some(13)));
2183-
let c = gr_inds.count();
2184-
assert_eq!(c, 4);
2185-
let e2 = gr_inds.size_hint();
2180+
let mut gr_inds_iter = s.grapheme_indices(true);
2181+
{
2182+
let gr_inds = gr_inds_iter.by_ref();
2183+
let e1 = gr_inds.size_hint();
2184+
assert_eq!(e1, (1, Some(13)));
2185+
let c = gr_inds.count();
2186+
assert_eq!(c, 4);
2187+
}
2188+
let e2 = gr_inds_iter.size_hint();
21862189
assert_eq!(e2, (0, Some(0)));
21872190

21882191
// make sure the reverse iterator does the right thing with "\n" at beginning of string
@@ -2319,7 +2322,7 @@ mod bench {
23192322
use test::Bencher;
23202323
use test::black_box;
23212324
use super::*;
2322-
use std::iter::{Iterator, DoubleEndedIterator};
2325+
use std::iter::{IteratorExt, DoubleEndedIteratorExt};
23232326
use std::str::StrPrelude;
23242327
use std::slice::SlicePrelude;
23252328

branches/try/src/libcollections/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ impl<T> DoubleEndedIterator<T> for MoveItems<T> {
13411341
}
13421342
}
13431343

1344-
impl<T> ExactSize<T> for MoveItems<T> {}
1344+
impl<T> ExactSizeIterator<T> for MoveItems<T> {}
13451345

13461346
#[unsafe_destructor]
13471347
impl<T> Drop for MoveItems<T> {

branches/try/src/libcore/fmt/float.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub use self::SignFormat::*;
1717
use char;
1818
use char::Char;
1919
use fmt;
20-
use iter::{range, DoubleEndedIterator};
20+
use iter::{range, DoubleEndedIteratorExt};
2121
use num::{Float, FPNaN, FPInfinite, ToPrimitive};
2222
use num::cast;
2323
use result::Ok;

branches/try/src/libcore/fmt/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
use any;
1616
use cell::{Cell, Ref, RefMut};
17-
use iter::{Iterator, range};
17+
use iter::{Iterator, IteratorExt, range};
1818
use kinds::{Copy, Sized};
1919
use mem;
2020
use option::{Option, Some, None};

branches/try/src/libcore/fmt/num.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#![allow(unsigned_negation)]
1616

1717
use fmt;
18-
use iter::DoubleEndedIterator;
18+
use iter::DoubleEndedIteratorExt;
1919
use num::{Int, cast};
2020
use slice::SlicePrelude;
2121

0 commit comments

Comments
 (0)