Skip to content

Commit a461f75

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 167862 b: refs/heads/master c: 6b116be h: refs/heads/master v: v3
1 parent aa8e8c3 commit a461f75

File tree

14 files changed

+212
-125
lines changed

14 files changed

+212
-125
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 8c59ec048831c913110a0aa385b1cb6f29de28d7
2+
refs/heads/master: 6b116bedafe29b7876b95575451c92452a1ec72b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c89417130f042c58adc60012e7cddc4ef70b70b9
55
refs/heads/try: 5204084bd2e46af7cc6e0147430e44dd0d657bbb

trunk/src/libcollections/binary_heap.rs

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,9 @@ impl<'a, T> Clone for Iter<'a, T> {
573573
}
574574

575575
#[stable]
576-
impl<'a, T> Iterator<&'a T> for Iter<'a, T> {
576+
impl<'a, T> Iterator for Iter<'a, T> {
577+
type Item = &'a T;
578+
577579
#[inline]
578580
fn next(&mut self) -> Option<&'a T> { self.iter.next() }
579581

@@ -582,21 +584,23 @@ impl<'a, T> Iterator<&'a T> for Iter<'a, T> {
582584
}
583585

584586
#[stable]
585-
impl<'a, T> DoubleEndedIterator<&'a T> for Iter<'a, T> {
587+
impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
586588
#[inline]
587589
fn next_back(&mut self) -> Option<&'a T> { self.iter.next_back() }
588590
}
589591

590592
#[stable]
591-
impl<'a, T> ExactSizeIterator<&'a T> for Iter<'a, T> {}
593+
impl<'a, T> ExactSizeIterator for Iter<'a, T> {}
592594

593595
/// An iterator that moves out of a `BinaryHeap`.
594596
pub struct IntoIter<T> {
595597
iter: vec::IntoIter<T>,
596598
}
597599

598600
#[stable]
599-
impl<T> Iterator<T> for IntoIter<T> {
601+
impl<T> Iterator for IntoIter<T> {
602+
type Item = T;
603+
600604
#[inline]
601605
fn next(&mut self) -> Option<T> { self.iter.next() }
602606

@@ -605,21 +609,23 @@ impl<T> Iterator<T> for IntoIter<T> {
605609
}
606610

607611
#[stable]
608-
impl<T> DoubleEndedIterator<T> for IntoIter<T> {
612+
impl<T> DoubleEndedIterator for IntoIter<T> {
609613
#[inline]
610614
fn next_back(&mut self) -> Option<T> { self.iter.next_back() }
611615
}
612616

613617
#[stable]
614-
impl<T> ExactSizeIterator<T> for IntoIter<T> {}
618+
impl<T> ExactSizeIterator for IntoIter<T> {}
615619

616620
/// An iterator that drains a `BinaryHeap`.
617621
pub struct Drain<'a, T: 'a> {
618622
iter: vec::Drain<'a, T>,
619623
}
620624

621625
#[stable]
622-
impl<'a, T: 'a> Iterator<T> for Drain<'a, T> {
626+
impl<'a, T: 'a> Iterator for Drain<'a, T> {
627+
type Item = T;
628+
623629
#[inline]
624630
fn next(&mut self) -> Option<T> { self.iter.next() }
625631

@@ -628,24 +634,24 @@ impl<'a, T: 'a> Iterator<T> for Drain<'a, T> {
628634
}
629635

630636
#[stable]
631-
impl<'a, T: 'a> DoubleEndedIterator<T> for Drain<'a, T> {
637+
impl<'a, T: 'a> DoubleEndedIterator for Drain<'a, T> {
632638
#[inline]
633639
fn next_back(&mut self) -> Option<T> { self.iter.next_back() }
634640
}
635641

636642
#[stable]
637-
impl<'a, T: 'a> ExactSizeIterator<T> for Drain<'a, T> {}
643+
impl<'a, T: 'a> ExactSizeIterator for Drain<'a, T> {}
638644

639645
#[stable]
640646
impl<T: Ord> FromIterator<T> for BinaryHeap<T> {
641-
fn from_iter<Iter: Iterator<T>>(iter: Iter) -> BinaryHeap<T> {
647+
fn from_iter<Iter: Iterator<Item=T>>(iter: Iter) -> BinaryHeap<T> {
642648
BinaryHeap::from_vec(iter.collect())
643649
}
644650
}
645651

646652
#[stable]
647653
impl<T: Ord> Extend<T> for BinaryHeap<T> {
648-
fn extend<Iter: Iterator<T>>(&mut self, mut iter: Iter) {
654+
fn extend<Iter: Iterator<Item=T>>(&mut self, mut iter: Iter) {
649655
let (lower, _) = iter.size_hint();
650656

651657
self.reserve(lower);

trunk/src/libcollections/bit.rs

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ impl Default for Bitv {
938938

939939
#[stable]
940940
impl FromIterator<bool> for Bitv {
941-
fn from_iter<I:Iterator<bool>>(iterator: I) -> Bitv {
941+
fn from_iter<I:Iterator<Item=bool>>(iterator: I) -> Bitv {
942942
let mut ret = Bitv::new();
943943
ret.extend(iterator);
944944
ret
@@ -948,7 +948,7 @@ impl FromIterator<bool> for Bitv {
948948
#[stable]
949949
impl Extend<bool> for Bitv {
950950
#[inline]
951-
fn extend<I: Iterator<bool>>(&mut self, mut iterator: I) {
951+
fn extend<I: Iterator<Item=bool>>(&mut self, mut iterator: I) {
952952
let (min, _) = iterator.size_hint();
953953
self.reserve(min);
954954
for element in iterator {
@@ -1031,7 +1031,9 @@ pub struct Iter<'a> {
10311031
}
10321032

10331033
#[stable]
1034-
impl<'a> Iterator<bool> for Iter<'a> {
1034+
impl<'a> Iterator for Iter<'a> {
1035+
type Item = bool;
1036+
10351037
#[inline]
10361038
fn next(&mut self) -> Option<bool> {
10371039
if self.next_idx != self.end_idx {
@@ -1050,7 +1052,7 @@ impl<'a> Iterator<bool> for Iter<'a> {
10501052
}
10511053

10521054
#[stable]
1053-
impl<'a> DoubleEndedIterator<bool> for Iter<'a> {
1055+
impl<'a> DoubleEndedIterator for Iter<'a> {
10541056
#[inline]
10551057
fn next_back(&mut self) -> Option<bool> {
10561058
if self.next_idx != self.end_idx {
@@ -1063,10 +1065,10 @@ impl<'a> DoubleEndedIterator<bool> for Iter<'a> {
10631065
}
10641066

10651067
#[stable]
1066-
impl<'a> ExactSizeIterator<bool> for Iter<'a> {}
1068+
impl<'a> ExactSizeIterator for Iter<'a> {}
10671069

10681070
#[stable]
1069-
impl<'a> RandomAccessIterator<bool> for Iter<'a> {
1071+
impl<'a> RandomAccessIterator for Iter<'a> {
10701072
#[inline]
10711073
fn indexable(&self) -> uint {
10721074
self.end_idx - self.next_idx
@@ -1134,7 +1136,7 @@ impl Default for BitvSet {
11341136

11351137
#[stable]
11361138
impl FromIterator<uint> for BitvSet {
1137-
fn from_iter<I:Iterator<uint>>(iterator: I) -> BitvSet {
1139+
fn from_iter<I:Iterator<Item=uint>>(iterator: I) -> BitvSet {
11381140
let mut ret = BitvSet::new();
11391141
ret.extend(iterator);
11401142
ret
@@ -1144,7 +1146,7 @@ impl FromIterator<uint> for BitvSet {
11441146
#[stable]
11451147
impl Extend<uint> for BitvSet {
11461148
#[inline]
1147-
fn extend<I: Iterator<uint>>(&mut self, mut iterator: I) {
1149+
fn extend<I: Iterator<Item=uint>>(&mut self, mut iterator: I) {
11481150
for i in iterator {
11491151
self.insert(i);
11501152
}
@@ -1792,7 +1794,9 @@ pub struct Difference<'a>(TwoBitPositions<'a>);
17921794
pub struct SymmetricDifference<'a>(TwoBitPositions<'a>);
17931795

17941796
#[stable]
1795-
impl<'a> Iterator<uint> for SetIter<'a> {
1797+
impl<'a> Iterator for SetIter<'a> {
1798+
type Item = uint;
1799+
17961800
fn next(&mut self) -> Option<uint> {
17971801
while self.next_idx < self.set.bitv.len() {
17981802
let idx = self.next_idx;
@@ -1813,7 +1817,9 @@ impl<'a> Iterator<uint> for SetIter<'a> {
18131817
}
18141818

18151819
#[stable]
1816-
impl<'a> Iterator<uint> for TwoBitPositions<'a> {
1820+
impl<'a> Iterator for TwoBitPositions<'a> {
1821+
type Item = uint;
1822+
18171823
fn next(&mut self) -> Option<uint> {
18181824
while self.next_idx < self.set.bitv.len() ||
18191825
self.next_idx < self.other.bitv.len() {
@@ -1849,25 +1855,33 @@ impl<'a> Iterator<uint> for TwoBitPositions<'a> {
18491855
}
18501856

18511857
#[stable]
1852-
impl<'a> Iterator<uint> for Union<'a> {
1858+
impl<'a> Iterator for Union<'a> {
1859+
type Item = uint;
1860+
18531861
#[inline] fn next(&mut self) -> Option<uint> { self.0.next() }
18541862
#[inline] fn size_hint(&self) -> (uint, Option<uint>) { self.0.size_hint() }
18551863
}
18561864

18571865
#[stable]
1858-
impl<'a> Iterator<uint> for Intersection<'a> {
1866+
impl<'a> Iterator for Intersection<'a> {
1867+
type Item = uint;
1868+
18591869
#[inline] fn next(&mut self) -> Option<uint> { self.0.next() }
18601870
#[inline] fn size_hint(&self) -> (uint, Option<uint>) { self.0.size_hint() }
18611871
}
18621872

18631873
#[stable]
1864-
impl<'a> Iterator<uint> for Difference<'a> {
1874+
impl<'a> Iterator for Difference<'a> {
1875+
type Item = uint;
1876+
18651877
#[inline] fn next(&mut self) -> Option<uint> { self.0.next() }
18661878
#[inline] fn size_hint(&self) -> (uint, Option<uint>) { self.0.size_hint() }
18671879
}
18681880

18691881
#[stable]
1870-
impl<'a> Iterator<uint> for SymmetricDifference<'a> {
1882+
impl<'a> Iterator for SymmetricDifference<'a> {
1883+
type Item = uint;
1884+
18711885
#[inline] fn next(&mut self) -> Option<uint> { self.0.next() }
18721886
#[inline] fn size_hint(&self) -> (uint, Option<uint>) { self.0.size_hint() }
18731887
}

trunk/src/libcollections/btree/map.rs

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ mod stack {
823823

824824
#[stable]
825825
impl<K: Ord, V> FromIterator<(K, V)> for BTreeMap<K, V> {
826-
fn from_iter<T: Iterator<(K, V)>>(iter: T) -> BTreeMap<K, V> {
826+
fn from_iter<T: Iterator<Item=(K, V)>>(iter: T) -> BTreeMap<K, V> {
827827
let mut map = BTreeMap::new();
828828
map.extend(iter);
829829
map
@@ -833,7 +833,7 @@ impl<K: Ord, V> FromIterator<(K, V)> for BTreeMap<K, V> {
833833
#[stable]
834834
impl<K: Ord, V> Extend<(K, V)> for BTreeMap<K, V> {
835835
#[inline]
836-
fn extend<T: Iterator<(K, V)>>(&mut self, mut iter: T) {
836+
fn extend<T: Iterator<Item=(K, V)>>(&mut self, mut iter: T) {
837837
for (k, v) in iter {
838838
self.insert(k, v);
839839
}
@@ -949,8 +949,11 @@ enum StackOp<T> {
949949
Pop,
950950
}
951951

952-
impl<K, V, E, T: Traverse<E> + DoubleEndedIterator<TraversalItem<K, V, E>>>
953-
Iterator<(K, V)> for AbsIter<T> {
952+
impl<K, V, E, T> Iterator for AbsIter<T> where
953+
T: DoubleEndedIterator + Iterator<Item=TraversalItem<K, V, E>> + Traverse<E>,
954+
{
955+
type Item = (K, V);
956+
954957
// This function is pretty long, but only because there's a lot of cases to consider.
955958
// Our iterator represents two search paths, left and right, to the smallest and largest
956959
// elements we have yet to yield. lca represents the least common ancestor of these two paths,
@@ -1015,8 +1018,9 @@ impl<K, V, E, T: Traverse<E> + DoubleEndedIterator<TraversalItem<K, V, E>>>
10151018
}
10161019
}
10171020

1018-
impl<K, V, E, T: Traverse<E> + DoubleEndedIterator<TraversalItem<K, V, E>>>
1019-
DoubleEndedIterator<(K, V)> for AbsIter<T> {
1021+
impl<K, V, E, T> DoubleEndedIterator for AbsIter<T> where
1022+
T: DoubleEndedIterator + Iterator<Item=TraversalItem<K, V, E>> + Traverse<E>,
1023+
{
10201024
// next_back is totally symmetric to next
10211025
fn next_back(&mut self) -> Option<(K, V)> {
10221026
loop {
@@ -1054,64 +1058,75 @@ impl<K, V, E, T: Traverse<E> + DoubleEndedIterator<TraversalItem<K, V, E>>>
10541058
}
10551059

10561060
#[stable]
1057-
impl<'a, K, V> Iterator<(&'a K, &'a V)> for Iter<'a, K, V> {
1061+
impl<'a, K, V> Iterator for Iter<'a, K, V> {
1062+
type Item = (&'a K, &'a V);
1063+
10581064
fn next(&mut self) -> Option<(&'a K, &'a V)> { self.inner.next() }
10591065
fn size_hint(&self) -> (uint, Option<uint>) { self.inner.size_hint() }
10601066
}
10611067
#[stable]
1062-
impl<'a, K, V> DoubleEndedIterator<(&'a K, &'a V)> for Iter<'a, K, V> {
1068+
impl<'a, K, V> DoubleEndedIterator for Iter<'a, K, V> {
10631069
fn next_back(&mut self) -> Option<(&'a K, &'a V)> { self.inner.next_back() }
10641070
}
10651071
#[stable]
1066-
impl<'a, K, V> ExactSizeIterator<(&'a K, &'a V)> for Iter<'a, K, V> {}
1072+
impl<'a, K, V> ExactSizeIterator for Iter<'a, K, V> {}
10671073

10681074
#[stable]
1069-
impl<'a, K, V> Iterator<(&'a K, &'a mut V)> for IterMut<'a, K, V> {
1075+
impl<'a, K, V> Iterator for IterMut<'a, K, V> {
1076+
type Item = (&'a K, &'a mut V);
1077+
10701078
fn next(&mut self) -> Option<(&'a K, &'a mut V)> { self.inner.next() }
10711079
fn size_hint(&self) -> (uint, Option<uint>) { self.inner.size_hint() }
10721080
}
10731081
#[stable]
1074-
impl<'a, K, V> DoubleEndedIterator<(&'a K, &'a mut V)> for IterMut<'a, K, V> {
1082+
impl<'a, K, V> DoubleEndedIterator for IterMut<'a, K, V> {
10751083
fn next_back(&mut self) -> Option<(&'a K, &'a mut V)> { self.inner.next_back() }
10761084
}
10771085
#[stable]
1078-
impl<'a, K, V> ExactSizeIterator<(&'a K, &'a mut V)> for IterMut<'a, K, V> {}
1086+
impl<'a, K, V> ExactSizeIterator for IterMut<'a, K, V> {}
10791087

10801088
#[stable]
1081-
impl<K, V> Iterator<(K, V)> for IntoIter<K, V> {
1089+
impl<K, V> Iterator for IntoIter<K, V> {
1090+
type Item = (K, V);
1091+
10821092
fn next(&mut self) -> Option<(K, V)> { self.inner.next() }
10831093
fn size_hint(&self) -> (uint, Option<uint>) { self.inner.size_hint() }
10841094
}
10851095
#[stable]
1086-
impl<K, V> DoubleEndedIterator<(K, V)> for IntoIter<K, V> {
1096+
impl<K, V> DoubleEndedIterator for IntoIter<K, V> {
10871097
fn next_back(&mut self) -> Option<(K, V)> { self.inner.next_back() }
10881098
}
10891099
#[stable]
1090-
impl<K, V> ExactSizeIterator<(K, V)> for IntoIter<K, V> {}
1100+
impl<K, V> ExactSizeIterator for IntoIter<K, V> {}
10911101

10921102
#[stable]
1093-
impl<'a, K, V> Iterator<&'a K> for Keys<'a, K, V> {
1103+
impl<'a, K, V> Iterator for Keys<'a, K, V> {
1104+
type Item = &'a K;
1105+
10941106
fn next(&mut self) -> Option<(&'a K)> { self.inner.next() }
10951107
fn size_hint(&self) -> (uint, Option<uint>) { self.inner.size_hint() }
10961108
}
10971109
#[stable]
1098-
impl<'a, K, V> DoubleEndedIterator<&'a K> for Keys<'a, K, V> {
1110+
impl<'a, K, V> DoubleEndedIterator for Keys<'a, K, V> {
10991111
fn next_back(&mut self) -> Option<(&'a K)> { self.inner.next_back() }
11001112
}
11011113
#[stable]
1102-
impl<'a, K, V> ExactSizeIterator<&'a K> for Keys<'a, K, V> {}
1114+
impl<'a, K, V> ExactSizeIterator for Keys<'a, K, V> {}
1115+
11031116

11041117
#[stable]
1105-
impl<'a, K, V> Iterator<&'a V> for Values<'a, K, V> {
1118+
impl<'a, K, V> Iterator for Values<'a, K, V> {
1119+
type Item = &'a V;
1120+
11061121
fn next(&mut self) -> Option<(&'a V)> { self.inner.next() }
11071122
fn size_hint(&self) -> (uint, Option<uint>) { self.inner.size_hint() }
11081123
}
11091124
#[stable]
1110-
impl<'a, K, V> DoubleEndedIterator<&'a V> for Values<'a, K, V> {
1125+
impl<'a, K, V> DoubleEndedIterator for Values<'a, K, V> {
11111126
fn next_back(&mut self) -> Option<(&'a V)> { self.inner.next_back() }
11121127
}
11131128
#[stable]
1114-
impl<'a, K, V> ExactSizeIterator<&'a V> for Values<'a, K, V> {}
1129+
impl<'a, K, V> ExactSizeIterator for Values<'a, K, V> {}
11151130

11161131

11171132
impl<'a, K: Ord, V> VacantEntry<'a, K, V> {

0 commit comments

Comments
 (0)