Skip to content

Commit 99b2bd4

Browse files
committed
rollup merge of #21842: alexcrichton/issue-21839
Now that associated types are fully implemented the iterator adaptors only need type parameters which are associated with actual storage. All other type parameters can either be derived from these (e.g. they are an associated type) or can be bare on the `impl` block itself. This is a breaking change due to the removal of type parameters on these iterator adaptors, but code can fairly easily migrate by just deleting the relevant type parameters for each adaptor. Other behavior should not be affected. Closes #21839 [breaking-change]
2 parents 747e6b5 + 0e44484 commit 99b2bd4

File tree

12 files changed

+137
-290
lines changed

12 files changed

+137
-290
lines changed

src/libcollections/btree/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ pub struct IntoIter<K, V> {
116116
/// An iterator over a BTreeMap's keys.
117117
#[stable(feature = "rust1", since = "1.0.0")]
118118
pub struct Keys<'a, K: 'a, V: 'a> {
119-
inner: Map<(&'a K, &'a V), &'a K, Iter<'a, K, V>, fn((&'a K, &'a V)) -> &'a K>
119+
inner: Map<Iter<'a, K, V>, fn((&'a K, &'a V)) -> &'a K>
120120
}
121121

122122
/// An iterator over a BTreeMap's values.
123123
#[stable(feature = "rust1", since = "1.0.0")]
124124
pub struct Values<'a, K: 'a, V: 'a> {
125-
inner: Map<(&'a K, &'a V), &'a V, Iter<'a, K, V>, fn((&'a K, &'a V)) -> &'a V>
125+
inner: Map<Iter<'a, K, V>, fn((&'a K, &'a V)) -> &'a V>
126126
}
127127

128128
/// An iterator over a sub-range of BTreeMap's entries.

src/libcollections/btree/set.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,40 +45,40 @@ pub struct Iter<'a, T: 'a> {
4545
/// An owning iterator over a BTreeSet's items.
4646
#[stable(feature = "rust1", since = "1.0.0")]
4747
pub struct IntoIter<T> {
48-
iter: Map<(T, ()), T, ::btree_map::IntoIter<T, ()>, fn((T, ())) -> T>
48+
iter: Map<::btree_map::IntoIter<T, ()>, fn((T, ())) -> T>
4949
}
5050

5151
/// An iterator over a sub-range of BTreeSet's items.
5252
pub struct Range<'a, T: 'a> {
53-
iter: Map<(&'a T, &'a ()), &'a T, ::btree_map::Range<'a, T, ()>, fn((&'a T, &'a ())) -> &'a T>
53+
iter: Map<::btree_map::Range<'a, T, ()>, fn((&'a T, &'a ())) -> &'a T>
5454
}
5555

5656
/// A lazy iterator producing elements in the set difference (in-order).
5757
#[stable(feature = "rust1", since = "1.0.0")]
5858
pub struct Difference<'a, T:'a> {
59-
a: Peekable<&'a T, Iter<'a, T>>,
60-
b: Peekable<&'a T, Iter<'a, T>>,
59+
a: Peekable<Iter<'a, T>>,
60+
b: Peekable<Iter<'a, T>>,
6161
}
6262

6363
/// A lazy iterator producing elements in the set symmetric difference (in-order).
6464
#[stable(feature = "rust1", since = "1.0.0")]
6565
pub struct SymmetricDifference<'a, T:'a> {
66-
a: Peekable<&'a T, Iter<'a, T>>,
67-
b: Peekable<&'a T, Iter<'a, T>>,
66+
a: Peekable<Iter<'a, T>>,
67+
b: Peekable<Iter<'a, T>>,
6868
}
6969

7070
/// A lazy iterator producing elements in the set intersection (in-order).
7171
#[stable(feature = "rust1", since = "1.0.0")]
7272
pub struct Intersection<'a, T:'a> {
73-
a: Peekable<&'a T, Iter<'a, T>>,
74-
b: Peekable<&'a T, Iter<'a, T>>,
73+
a: Peekable<Iter<'a, T>>,
74+
b: Peekable<Iter<'a, T>>,
7575
}
7676

7777
/// A lazy iterator producing elements in the set union (in-order).
7878
#[stable(feature = "rust1", since = "1.0.0")]
7979
pub struct Union<'a, T:'a> {
80-
a: Peekable<&'a T, Iter<'a, T>>,
81-
b: Peekable<&'a T, Iter<'a, T>>,
80+
a: Peekable<Iter<'a, T>>,
81+
b: Peekable<Iter<'a, T>>,
8282
}
8383

8484
impl<T: Ord> BTreeSet<T> {

src/libcollections/vec_map.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ double_ended_iterator! { impl IterMut -> (uint, &'a mut V), as_mut }
687687
/// An iterator over the keys of a map.
688688
#[stable(feature = "rust1", since = "1.0.0")]
689689
pub struct Keys<'a, V: 'a> {
690-
iter: Map<(uint, &'a V), uint, Iter<'a, V>, fn((uint, &'a V)) -> uint>
690+
iter: Map<Iter<'a, V>, fn((uint, &'a V)) -> uint>
691691
}
692692

693693
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
@@ -702,7 +702,7 @@ impl<'a, V> Clone for Keys<'a, V> {
702702
/// An iterator over the values of a map.
703703
#[stable(feature = "rust1", since = "1.0.0")]
704704
pub struct Values<'a, V: 'a> {
705-
iter: Map<(uint, &'a V), &'a V, Iter<'a, V>, fn((uint, &'a V)) -> &'a V>
705+
iter: Map<Iter<'a, V>, fn((uint, &'a V)) -> &'a V>
706706
}
707707

708708
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
@@ -718,17 +718,13 @@ impl<'a, V> Clone for Values<'a, V> {
718718
#[stable(feature = "rust1", since = "1.0.0")]
719719
pub struct IntoIter<V> {
720720
iter: FilterMap<
721-
(uint, Option<V>),
722-
(uint, V),
723721
Enumerate<vec::IntoIter<Option<V>>>,
724722
fn((uint, Option<V>)) -> Option<(uint, V)>>
725723
}
726724

727725
#[unstable(feature = "collections")]
728726
pub struct Drain<'a, V> {
729727
iter: FilterMap<
730-
(uint, Option<V>),
731-
(uint, V),
732728
Enumerate<vec::Drain<'a, Option<V>>>,
733729
fn((uint, Option<V>)) -> Option<(uint, V)>>
734730
}

0 commit comments

Comments
 (0)