Skip to content

Commit cc68786

Browse files
committed
std: Stabilize the IntoIterator trait
Now that the necessary associated types exist for the `IntoIterator` trait this commit stabilizes the trait as-is as well as all existing implementations.
1 parent f1bb6c2 commit cc68786

File tree

14 files changed

+35
-0
lines changed

14 files changed

+35
-0
lines changed

src/libcollections/binary_heap.rs

+2
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,7 @@ impl<T: Ord> IntoIterator for BinaryHeap<T> {
666666
}
667667

668668
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
669+
#[stable(feature = "rust1", since = "1.0.0")]
669670
impl<T: Ord> IntoIterator for BinaryHeap<T> {
670671
type Item = T;
671672
type IntoIter = IntoIter<T>;
@@ -686,6 +687,7 @@ impl<'a, T> IntoIterator for &'a BinaryHeap<T> where T: Ord {
686687
}
687688

688689
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
690+
#[stable(feature = "rust1", since = "1.0.0")]
689691
impl<'a, T> IntoIterator for &'a BinaryHeap<T> where T: Ord {
690692
type Item = &'a T;
691693
type IntoIter = Iter<'a, T>;

src/libcollections/bit.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,7 @@ impl<'a> IntoIterator for &'a Bitv {
10811081
}
10821082

10831083
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
1084+
#[stable(feature = "rust1", since = "1.0.0")]
10841085
impl<'a> IntoIterator for &'a Bitv {
10851086
type Item = bool;
10861087
type IntoIter = Iter<'a>;
@@ -1905,6 +1906,7 @@ impl<'a> IntoIterator for &'a BitvSet {
19051906
}
19061907

19071908
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
1909+
#[stable(feature = "rust1", since = "1.0.0")]
19081910
impl<'a> IntoIterator for &'a BitvSet {
19091911
type Item = usize;
19101912
type IntoIter = SetIter<'a>;

src/libcollections/btree/map.rs

+3
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ impl<K, V> IntoIterator for BTreeMap<K, V> {
473473
}
474474

475475
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
476+
#[stable(feature = "rust1", since = "1.0.0")]
476477
impl<K, V> IntoIterator for BTreeMap<K, V> {
477478
type Item = (K, V);
478479
type IntoIter = IntoIter<K, V>;
@@ -493,6 +494,7 @@ impl<'a, K, V> IntoIterator for &'a BTreeMap<K, V> {
493494
}
494495

495496
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
497+
#[stable(feature = "rust1", since = "1.0.0")]
496498
impl<'a, K, V> IntoIterator for &'a BTreeMap<K, V> {
497499
type Item = (&'a K, &'a V);
498500
type IntoIter = Iter<'a, K, V>;
@@ -513,6 +515,7 @@ impl<'a, K, V> IntoIterator for &'a mut BTreeMap<K, V> {
513515
}
514516

515517
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
518+
#[stable(feature = "rust1", since = "1.0.0")]
516519
impl<'a, K, V> IntoIterator for &'a mut BTreeMap<K, V> {
517520
type Item = (&'a K, &'a mut V);
518521
type IntoIter = IterMut<'a, K, V>;

src/libcollections/btree/set.rs

+2
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ impl<T> IntoIterator for BTreeSet<T> {
491491
}
492492

493493
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
494+
#[stable(feature = "rust1", since = "1.0.0")]
494495
impl<T> IntoIterator for BTreeSet<T> {
495496
type Item = T;
496497
type IntoIter = IntoIter<T>;
@@ -511,6 +512,7 @@ impl<'a, T> IntoIterator for &'a BTreeSet<T> {
511512
}
512513

513514
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
515+
#[stable(feature = "rust1", since = "1.0.0")]
514516
impl<'a, T> IntoIterator for &'a BTreeSet<T> {
515517
type Item = &'a T;
516518
type IntoIter = Iter<'a, T>;

src/libcollections/dlist.rs

+2
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,7 @@ impl<T> IntoIterator for DList<T> {
848848
}
849849

850850
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
851+
#[stable(feature = "rust1", since = "1.0.0")]
851852
impl<T> IntoIterator for DList<T> {
852853
type Item = T;
853854
type IntoIter = IntoIter<T>;
@@ -868,6 +869,7 @@ impl<'a, T> IntoIterator for &'a DList<T> {
868869
}
869870

870871
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
872+
#[stable(feature = "rust1", since = "1.0.0")]
871873
impl<'a, T> IntoIterator for &'a DList<T> {
872874
type Item = &'a T;
873875
type IntoIter = Iter<'a, T>;

src/libcollections/enum_set.rs

+1
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ impl<'a, E> IntoIterator for &'a EnumSet<E> where E: CLike {
268268
}
269269

270270
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
271+
#[stable(feature = "rust1", since = "1.0.0")]
271272
impl<'a, E> IntoIterator for &'a EnumSet<E> where E: CLike {
272273
type Item = E;
273274
type IntoIter = Iter<E>;

src/libcollections/ring_buf.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1710,6 +1710,7 @@ impl<T> IntoIterator for RingBuf<T> {
17101710
}
17111711

17121712
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
1713+
#[stable(feature = "rust1", since = "1.0.0")]
17131714
impl<T> IntoIterator for RingBuf<T> {
17141715
type Item = T;
17151716
type IntoIter = IntoIter<T>;
@@ -1730,6 +1731,7 @@ impl<'a, T> IntoIterator for &'a RingBuf<T> {
17301731
}
17311732

17321733
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
1734+
#[stable(feature = "rust1", since = "1.0.0")]
17331735
impl<'a, T> IntoIterator for &'a RingBuf<T> {
17341736
type Item = &'a T;
17351737
type IntoIter = Iter<'a, T>;
@@ -1750,6 +1752,7 @@ impl<'a, T> IntoIterator for &'a mut RingBuf<T> {
17501752
}
17511753

17521754
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
1755+
#[stable(feature = "rust1", since = "1.0.0")]
17531756
impl<'a, T> IntoIterator for &'a mut RingBuf<T> {
17541757
type Item = &'a mut T;
17551758
type IntoIter = IterMut<'a, T>;

src/libcollections/vec.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1425,6 +1425,7 @@ impl<T> IntoIterator for Vec<T> {
14251425
}
14261426

14271427
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
1428+
#[stable(feature = "rust1", since = "1.0.0")]
14281429
impl<T> IntoIterator for Vec<T> {
14291430
type Item = T;
14301431
type IntoIter = IntoIter<T>;
@@ -1445,6 +1446,7 @@ impl<'a, T> IntoIterator for &'a Vec<T> {
14451446
}
14461447

14471448
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
1449+
#[stable(feature = "rust1", since = "1.0.0")]
14481450
impl<'a, T> IntoIterator for &'a Vec<T> {
14491451
type Item = &'a T;
14501452
type IntoIter = slice::Iter<'a, T>;
@@ -1465,6 +1467,7 @@ impl<'a, T> IntoIterator for &'a mut Vec<T> {
14651467
}
14661468

14671469
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
1470+
#[stable(feature = "rust1", since = "1.0.0")]
14681471
impl<'a, T> IntoIterator for &'a mut Vec<T> {
14691472
type Item = &'a mut T;
14701473
type IntoIter = slice::IterMut<'a, T>;

src/libcollections/vec_map.rs

+3
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ impl<T> IntoIterator for VecMap<T> {
679679
}
680680

681681
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
682+
#[stable(feature = "rust1", since = "1.0.0")]
682683
impl<T> IntoIterator for VecMap<T> {
683684
type Item = (usize, T);
684685
type IntoIter = IntoIter<T>;
@@ -699,6 +700,7 @@ impl<'a, T> IntoIterator for &'a VecMap<T> {
699700
}
700701

701702
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
703+
#[stable(feature = "rust1", since = "1.0.0")]
702704
impl<'a, T> IntoIterator for &'a VecMap<T> {
703705
type Item = (usize, &'a T);
704706
type IntoIter = Iter<'a, T>;
@@ -719,6 +721,7 @@ impl<'a, T> IntoIterator for &'a mut VecMap<T> {
719721
}
720722

721723
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
724+
#[stable(feature = "rust1", since = "1.0.0")]
722725
impl<'a, T> IntoIterator for &'a mut VecMap<T> {
723726
type Item = (usize, &'a mut T);
724727
type IntoIter = IterMut<'a, T>;

src/libcore/array.rs

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ macro_rules! array_impls {
5959
}
6060

6161
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
62+
#[stable(feature = "rust1", since = "1.0.0")]
6263
impl<'a, T> IntoIterator for &'a [T; $N] {
6364
type Item = &'a T;
6465
type IntoIter = Iter<'a, T>;
@@ -79,6 +80,7 @@ macro_rules! array_impls {
7980
}
8081

8182
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
83+
#[stable(feature = "rust1", since = "1.0.0")]
8284
impl<'a, T> IntoIterator for &'a mut [T; $N] {
8385
type Item = &'a mut T;
8486
type IntoIter = IterMut<'a, T>;

src/libcore/iter.rs

+5
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,12 @@ pub trait IntoIterator {
131131

132132
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
133133
/// Conversion into an `Iterator`
134+
#[stable(feature = "rust1", since = "1.0.0")]
134135
pub trait IntoIterator {
136+
#[stable(feature = "rust1", since = "1.0.0")]
135137
type Item;
138+
139+
#[stable(feature = "rust1", since = "1.0.0")]
136140
type IntoIter: Iterator<Item=Self::Item>;
137141

138142
/// Consumes `Self` and returns an iterator over it
@@ -151,6 +155,7 @@ impl<I> IntoIterator for I where I: Iterator {
151155
}
152156

153157
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
158+
#[stable(feature = "rust1", since = "1.0.0")]
154159
impl<I: Iterator> IntoIterator for I {
155160
type Item = I::Item;
156161
type IntoIter = I;

src/libcore/slice.rs

+2
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,7 @@ impl<'a, T> IntoIterator for &'a [T] {
637637
}
638638

639639
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
640+
#[stable(feature = "rust1", since = "1.0.0")]
640641
impl<'a, T> IntoIterator for &'a [T] {
641642
type Item = &'a T;
642643
type IntoIter = Iter<'a, T>;
@@ -657,6 +658,7 @@ impl<'a, T> IntoIterator for &'a mut [T] {
657658
}
658659

659660
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
661+
#[stable(feature = "rust1", since = "1.0.0")]
660662
impl<'a, T> IntoIterator for &'a mut [T] {
661663
type Item = &'a mut T;
662664
type IntoIter = IterMut<'a, T>;

src/libstd/collections/hash/map.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,7 @@ impl<'a, K, V, S, H> IntoIterator for &'a HashMap<K, V, S>
13871387
}
13881388

13891389
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
1390+
#[stable(feature = "rust1", since = "1.0.0")]
13901391
impl<'a, K, V, S, H> IntoIterator for &'a HashMap<K, V, S>
13911392
where K: Eq + Hash<H>,
13921393
S: HashState<Hasher=H>,
@@ -1415,6 +1416,7 @@ impl<'a, K, V, S, H> IntoIterator for &'a mut HashMap<K, V, S>
14151416
}
14161417

14171418
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
1419+
#[stable(feature = "rust1", since = "1.0.0")]
14181420
impl<'a, K, V, S, H> IntoIterator for &'a mut HashMap<K, V, S>
14191421
where K: Eq + Hash<H>,
14201422
S: HashState<Hasher=H>,
@@ -1443,6 +1445,7 @@ impl<K, V, S, H> IntoIterator for HashMap<K, V, S>
14431445
}
14441446

14451447
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
1448+
#[stable(feature = "rust1", since = "1.0.0")]
14461449
impl<K, V, S, H> IntoIterator for HashMap<K, V, S>
14471450
where K: Eq + Hash<H>,
14481451
S: HashState<Hasher=H>,

src/libstd/collections/hash/set.rs

+2
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,7 @@ impl<'a, T, S, H> IntoIterator for &'a HashSet<T, S>
850850
}
851851

852852
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
853+
#[stable(feature = "rust1", since = "1.0.0")]
853854
impl<'a, T, S, H> IntoIterator for &'a HashSet<T, S>
854855
where T: Eq + Hash<H>,
855856
S: HashState<Hasher=H>,
@@ -878,6 +879,7 @@ impl<T, S, H> IntoIterator for HashSet<T, S>
878879
}
879880

880881
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
882+
#[stable(feature = "rust1", since = "1.0.0")]
881883
impl<T, S, H> IntoIterator for HashSet<T, S>
882884
where T: Eq + Hash<H>,
883885
S: HashState<Hasher=H>,

0 commit comments

Comments
 (0)