Skip to content

Commit 2e883a5

Browse files
committed
rollup merge of #20560: aturon/stab-2-iter-ops-slice
Conflicts: src/libcollections/slice.rs src/libcore/iter.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/rwlock.rs
2 parents bb5e16b + c6f4a03 commit 2e883a5

32 files changed

+574
-362
lines changed

src/liballoc/arc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl<T> BorrowFrom<Arc<T>> for T {
246246
}
247247
}
248248

249-
#[experimental = "Deref is experimental."]
249+
#[stable]
250250
impl<T> Deref for Arc<T> {
251251
type Target = T;
252252

@@ -290,7 +290,7 @@ impl<T: Send + Sync + Clone> Arc<T> {
290290
}
291291

292292
#[unsafe_destructor]
293-
#[experimental = "waiting on stability of Drop"]
293+
#[stable]
294294
impl<T: Sync + Send> Drop for Arc<T> {
295295
/// Drops the `Arc<T>`.
296296
///
@@ -418,7 +418,7 @@ impl<T: Sync + Send> Clone for Weak<T> {
418418
}
419419

420420
#[unsafe_destructor]
421-
#[experimental = "Weak pointers may not belong in this module."]
421+
#[stable]
422422
impl<T: Sync + Send> Drop for Weak<T> {
423423
/// Drops the `Weak<T>`.
424424
///

src/liballoc/boxed.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,14 @@ impl fmt::Show for Box<Any> {
155155
}
156156
}
157157

158+
#[stable]
158159
impl<Sized? T> Deref for Box<T> {
159160
type Target = T;
160161

161162
fn deref(&self) -> &T { &**self }
162163
}
163164

165+
#[stable]
164166
impl<Sized? T> DerefMut for Box<T> {
165167
fn deref_mut(&mut self) -> &mut T { &mut **self }
166168
}

src/liballoc/rc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ impl<T> BorrowFrom<Rc<T>> for T {
354354
}
355355
}
356356

357-
#[experimental = "Deref is experimental."]
357+
#[stable]
358358
impl<T> Deref for Rc<T> {
359359
type Target = T;
360360

@@ -365,7 +365,7 @@ impl<T> Deref for Rc<T> {
365365
}
366366

367367
#[unsafe_destructor]
368-
#[experimental = "Drop is experimental."]
368+
#[stable]
369369
impl<T> Drop for Rc<T> {
370370
/// Drops the `Rc<T>`.
371371
///
@@ -656,7 +656,7 @@ impl<T> Weak<T> {
656656
}
657657

658658
#[unsafe_destructor]
659-
#[experimental = "Weak pointers may not belong in this module."]
659+
#[stable]
660660
impl<T> Drop for Weak<T> {
661661
/// Drops the `Weak<T>`.
662662
///

src/libcollections/binary_heap.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
//! ```
149149
150150
#![allow(missing_docs)]
151+
#![stable]
151152

152153
use core::prelude::*;
153154

@@ -561,11 +562,13 @@ impl<T: Ord> BinaryHeap<T> {
561562
}
562563

563564
/// `BinaryHeap` iterator.
565+
#[stable]
564566
pub struct Iter <'a, T: 'a> {
565567
iter: slice::Iter<'a, T>,
566568
}
567569

568570
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
571+
#[stable]
569572
impl<'a, T> Clone for Iter<'a, T> {
570573
fn clone(&self) -> Iter<'a, T> {
571574
Iter { iter: self.iter.clone() }
@@ -593,6 +596,7 @@ impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
593596
impl<'a, T> ExactSizeIterator for Iter<'a, T> {}
594597

595598
/// An iterator that moves out of a `BinaryHeap`.
599+
#[stable]
596600
pub struct IntoIter<T> {
597601
iter: vec::IntoIter<T>,
598602
}
@@ -618,6 +622,7 @@ impl<T> DoubleEndedIterator for IntoIter<T> {
618622
impl<T> ExactSizeIterator for IntoIter<T> {}
619623

620624
/// An iterator that drains a `BinaryHeap`.
625+
#[unstable = "recent addition"]
621626
pub struct Drain<'a, T: 'a> {
622627
iter: vec::Drain<'a, T>,
623628
}

src/libcollections/dlist.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
// Backlinks over DList::prev are raw pointers that form a full chain in
2020
// the reverse direction.
2121

22+
#![stable]
23+
2224
use core::prelude::*;
2325

2426
use alloc::boxed::Box;

src/libcollections/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,23 @@ pub mod string;
6565
pub mod vec;
6666
pub mod vec_map;
6767

68+
#[stable]
6869
pub mod bitv {
6970
pub use bit::{Bitv, Iter};
7071
}
7172

73+
#[stable]
7274
pub mod bitv_set {
7375
pub use bit::{BitvSet, Union, Intersection, Difference, SymmetricDifference};
7476
pub use bit::SetIter as Iter;
7577
}
7678

79+
#[stable]
7780
pub mod btree_map {
7881
pub use btree::map::*;
7982
}
8083

84+
#[stable]
8185
pub mod btree_set {
8286
pub use btree::set::*;
8387
}
@@ -109,8 +113,7 @@ mod prelude {
109113
pub use core::iter::range;
110114
pub use core::iter::{FromIterator, Extend, IteratorExt};
111115
pub use core::iter::{Iterator, DoubleEndedIterator, RandomAccessIterator};
112-
pub use core::iter::{IteratorCloneExt, CloneIteratorExt};
113-
pub use core::iter::{IteratorOrdExt, MutableDoubleEndedIterator, ExactSizeIterator};
116+
pub use core::iter::{ExactSizeIterator};
114117
pub use core::kinds::{Copy, Send, Sized, Sync};
115118
pub use core::mem::drop;
116119
pub use core::ops::{Drop, Fn, FnMut, FnOnce};

src/libcollections/ring_buf.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
//! ends of the container. It also has `O(1)` indexing like a vector. The contained elements are
1313
//! not required to be copyable, and the queue will be sendable if the contained type is sendable.
1414
15+
#![stable]
16+
1517
use core::prelude::*;
1618

1719
use core::cmp::Ordering;

src/libcollections/slice.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
//! * Further iterators exist that split, chunk or permute the slice.
8787
8888
#![doc(primitive = "slice")]
89+
#![stable]
8990

9091
use alloc::boxed::Box;
9192
use core::borrow::{BorrowFrom, BorrowFromMut, ToOwned};
@@ -121,8 +122,10 @@ pub type MutItems<'a, T:'a> = IterMut<'a, T>;
121122
////////////////////////////////////////////////////////////////////////////////
122123

123124
/// Allocating extension methods for slices.
124-
#[unstable = "needs associated types, may merge with other traits"]
125-
pub trait SliceExt<T> for Sized? {
125+
pub trait SliceExt for Sized? {
126+
#[stable]
127+
type Item;
128+
126129
/// Sorts the slice, in place, using `compare` to compare
127130
/// elements.
128131
///
@@ -561,8 +564,10 @@ pub trait SliceExt<T> for Sized? {
561564
fn as_mut_ptr(&mut self) -> *mut T;
562565
}
563566

564-
#[unstable = "trait is unstable"]
565-
impl<T> SliceExt<T> for [T] {
567+
#[stable]
568+
impl<T> SliceExt for [T] {
569+
type Item = T;
570+
566571
#[inline]
567572
fn sort_by<F>(&mut self, compare: F) where F: FnMut(&T, &T) -> Ordering {
568573
merge_sort(self, compare)
@@ -1113,7 +1118,10 @@ struct SizeDirection {
11131118
dir: Direction,
11141119
}
11151120

1116-
impl Iterator<(uint, uint)> for ElementSwaps {
1121+
#[stable]
1122+
impl Iterator for ElementSwaps {
1123+
type Item = (uint, uint);
1124+
11171125
#[inline]
11181126
fn next(&mut self) -> Option<(uint, uint)> {
11191127
fn new_pos(i: uint, s: Direction) -> uint {

src/libcollections/str.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,15 @@ enum DecompositionType {
165165
/// External iterator for a string's decomposition's characters.
166166
/// Use with the `std::iter` module.
167167
#[derive(Clone)]
168+
#[unstable]
168169
pub struct Decompositions<'a> {
169170
kind: DecompositionType,
170171
iter: Chars<'a>,
171172
buffer: Vec<(char, u8)>,
172173
sorted: bool
173174
}
174175

176+
#[stable]
175177
impl<'a> Iterator for Decompositions<'a> {
176178
type Item = char;
177179

@@ -253,6 +255,7 @@ enum RecompositionState {
253255
/// External iterator for a string's recomposition's characters.
254256
/// Use with the `std::iter` module.
255257
#[derive(Clone)]
258+
#[unstable]
256259
pub struct Recompositions<'a> {
257260
iter: Decompositions<'a>,
258261
state: RecompositionState,
@@ -261,6 +264,7 @@ pub struct Recompositions<'a> {
261264
last_ccc: Option<u8>
262265
}
263266

267+
#[stable]
264268
impl<'a> Iterator for Recompositions<'a> {
265269
type Item = char;
266270

@@ -348,10 +352,12 @@ impl<'a> Iterator for Recompositions<'a> {
348352
/// External iterator for a string's UTF16 codeunits.
349353
/// Use with the `std::iter` module.
350354
#[derive(Clone)]
355+
#[unstable]
351356
pub struct Utf16Units<'a> {
352357
encoder: Utf16Encoder<Chars<'a>>
353358
}
354359

360+
#[stable]
355361
impl<'a> Iterator for Utf16Units<'a> {
356362
type Item = u16;
357363

src/libcollections/string.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ impl fmt::Show for FromUtf16Error {
687687
}
688688
}
689689

690-
#[experimental = "waiting on FromIterator stabilization"]
690+
#[stable]
691691
impl FromIterator<char> for String {
692692
fn from_iter<I:Iterator<Item=char>>(iterator: I) -> String {
693693
let mut buf = String::new();
@@ -696,7 +696,7 @@ impl FromIterator<char> for String {
696696
}
697697
}
698698

699-
#[experimental = "waiting on FromIterator stabilization"]
699+
#[stable]
700700
impl<'a> FromIterator<&'a str> for String {
701701
fn from_iter<I:Iterator<Item=&'a str>>(iterator: I) -> String {
702702
let mut buf = String::new();
@@ -808,7 +808,7 @@ impl<H: hash::Writer> hash::Hash<H> for String {
808808
}
809809
}
810810

811-
#[experimental = "waiting on Add stabilization"]
811+
#[unstable = "recent addition, needs more experience"]
812812
impl<'a> Add<&'a str> for String {
813813
type Output = String;
814814

@@ -840,7 +840,7 @@ impl ops::Slice<uint, str> for String {
840840
}
841841
}
842842

843-
#[experimental = "waiting on Deref stabilization"]
843+
#[stable]
844844
impl ops::Deref for String {
845845
type Target = str;
846846

0 commit comments

Comments
 (0)