Skip to content

Commit c6f4a03

Browse files
committed
Stabilization of impls and fallout from stabilization
1 parent cb765ce commit c6f4a03

29 files changed

+128
-49
lines changed

src/liballoc/arc.rs

+3-3
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

+2
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

+3-3
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

+4
Original file line numberDiff line numberDiff line change
@@ -562,11 +562,13 @@ impl<T: Ord> BinaryHeap<T> {
562562
}
563563

564564
/// `BinaryHeap` iterator.
565+
#[stable]
565566
pub struct Iter <'a, T: 'a> {
566567
iter: slice::Iter<'a, T>,
567568
}
568569

569570
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
571+
#[stable]
570572
impl<'a, T> Clone for Iter<'a, T> {
571573
fn clone(&self) -> Iter<'a, T> {
572574
Iter { iter: self.iter.clone() }
@@ -594,6 +596,7 @@ impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
594596
impl<'a, T> ExactSizeIterator for Iter<'a, T> {}
595597

596598
/// An iterator that moves out of a `BinaryHeap`.
599+
#[stable]
597600
pub struct IntoIter<T> {
598601
iter: vec::IntoIter<T>,
599602
}
@@ -619,6 +622,7 @@ impl<T> DoubleEndedIterator for IntoIter<T> {
619622
impl<T> ExactSizeIterator for IntoIter<T> {}
620623

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

src/libcollections/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ mod prelude {
113113
pub use core::iter::range;
114114
pub use core::iter::{FromIterator, Extend, IteratorExt};
115115
pub use core::iter::{Iterator, DoubleEndedIterator, RandomAccessIterator};
116-
pub use core::iter::{IteratorCloneExt, CloneIteratorExt};
117-
pub use core::iter::{IteratorOrdExt, MutableDoubleEndedIterator, ExactSizeIterator};
116+
pub use core::iter::{ExactSizeIterator};
118117
pub use core::kinds::{Copy, Send, Sized, Sync};
119118
pub use core::mem::drop;
120119
pub use core::ops::{Drop, Fn, FnMut, FnOnce};

src/libcollections/slice.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1092,6 +1092,7 @@ struct SizeDirection {
10921092
dir: Direction,
10931093
}
10941094

1095+
#[stable]
10951096
impl Iterator for ElementSwaps {
10961097
type Item = (uint, uint);
10971098

src/libcollections/str.rs

+6
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

+4-4
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ impl fmt::Show for FromUtf16Error {
711711
}
712712
}
713713

714-
#[experimental = "waiting on FromIterator stabilization"]
714+
#[stable]
715715
impl FromIterator<char> for String {
716716
fn from_iter<I:Iterator<Item=char>>(iterator: I) -> String {
717717
let mut buf = String::new();
@@ -720,7 +720,7 @@ impl FromIterator<char> for String {
720720
}
721721
}
722722

723-
#[experimental = "waiting on FromIterator stabilization"]
723+
#[stable]
724724
impl<'a> FromIterator<&'a str> for String {
725725
fn from_iter<I:Iterator<Item=&'a str>>(iterator: I) -> String {
726726
let mut buf = String::new();
@@ -832,7 +832,7 @@ impl<H: hash::Writer> hash::Hash<H> for String {
832832
}
833833
}
834834

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

@@ -864,7 +864,7 @@ impl ops::Slice<uint, str> for String {
864864
}
865865
}
866866

867-
#[experimental = "waiting on Deref stabilization"]
867+
#[stable]
868868
impl ops::Deref for String {
869869
type Target = str;
870870

src/libcollections/vec.rs

+15-4
Original file line numberDiff line numberDiff line change
@@ -1272,19 +1272,19 @@ impl<T> ops::SliceMut<uint, [T]> for Vec<T> {
12721272
}
12731273
}
12741274

1275-
#[experimental = "waiting on Deref stability"]
1275+
#[stable]
12761276
impl<T> ops::Deref for Vec<T> {
12771277
type Target = [T];
12781278

12791279
fn deref<'a>(&'a self) -> &'a [T] { self.as_slice() }
12801280
}
12811281

1282-
#[experimental = "waiting on DerefMut stability"]
1282+
#[stable]
12831283
impl<T> ops::DerefMut for Vec<T> {
12841284
fn deref_mut<'a>(&'a mut self) -> &'a mut [T] { self.as_mut_slice() }
12851285
}
12861286

1287-
#[experimental = "waiting on FromIterator stability"]
1287+
#[stable]
12881288
impl<T> FromIterator<T> for Vec<T> {
12891289
#[inline]
12901290
fn from_iter<I:Iterator<Item=T>>(mut iterator: I) -> Vec<T> {
@@ -1414,6 +1414,7 @@ impl<T> AsSlice<T> for Vec<T> {
14141414
}
14151415
}
14161416

1417+
#[unstable = "recent addition, needs more experience"]
14171418
impl<'a, T: Clone> Add<&'a [T]> for Vec<T> {
14181419
type Output = Vec<T>;
14191420

@@ -1425,6 +1426,7 @@ impl<'a, T: Clone> Add<&'a [T]> for Vec<T> {
14251426
}
14261427

14271428
#[unsafe_destructor]
1429+
#[stable]
14281430
impl<T> Drop for Vec<T> {
14291431
fn drop(&mut self) {
14301432
// This is (and should always remain) a no-op if the fields are
@@ -1470,6 +1472,7 @@ impl<'a> fmt::Writer for Vec<u8> {
14701472
/// A clone-on-write vector
14711473
pub type CowVec<'a, T> = Cow<'a, Vec<T>, [T]>;
14721474

1475+
#[unstable]
14731476
impl<'a, T> FromIterator<T> for CowVec<'a, T> where T: Clone {
14741477
fn from_iter<I: Iterator<Item=T>>(it: I) -> CowVec<'a, T> {
14751478
Cow::Owned(FromIterator::from_iter(it))
@@ -1515,6 +1518,7 @@ impl<T> IntoIter<T> {
15151518
}
15161519
}
15171520

1521+
#[stable]
15181522
impl<T> Iterator for IntoIter<T> {
15191523
type Item = T;
15201524

@@ -1551,6 +1555,7 @@ impl<T> Iterator for IntoIter<T> {
15511555
}
15521556
}
15531557

1558+
#[stable]
15541559
impl<T> DoubleEndedIterator for IntoIter<T> {
15551560
#[inline]
15561561
fn next_back<'a>(&'a mut self) -> Option<T> {
@@ -1574,9 +1579,11 @@ impl<T> DoubleEndedIterator for IntoIter<T> {
15741579
}
15751580
}
15761581

1582+
#[stable]
15771583
impl<T> ExactSizeIterator for IntoIter<T> {}
15781584

15791585
#[unsafe_destructor]
1586+
#[stable]
15801587
impl<T> Drop for IntoIter<T> {
15811588
fn drop(&mut self) {
15821589
// destroy the remaining elements
@@ -1598,6 +1605,7 @@ pub struct Drain<'a, T> {
15981605
marker: ContravariantLifetime<'a>,
15991606
}
16001607

1608+
#[stable]
16011609
impl<'a, T> Iterator for Drain<'a, T> {
16021610
type Item = T;
16031611

@@ -1634,6 +1642,7 @@ impl<'a, T> Iterator for Drain<'a, T> {
16341642
}
16351643
}
16361644

1645+
#[stable]
16371646
impl<'a, T> DoubleEndedIterator for Drain<'a, T> {
16381647
#[inline]
16391648
fn next_back(&mut self) -> Option<T> {
@@ -1657,9 +1666,11 @@ impl<'a, T> DoubleEndedIterator for Drain<'a, T> {
16571666
}
16581667
}
16591668

1669+
#[stable]
16601670
impl<'a, T> ExactSizeIterator for Drain<'a, T> {}
16611671

16621672
#[unsafe_destructor]
1673+
#[stable]
16631674
impl<'a, T> Drop for Drain<'a, T> {
16641675
fn drop(&mut self) {
16651676
// self.ptr == self.end == null if drop has already been called,
@@ -1692,7 +1703,7 @@ impl<'a, T> Deref for DerefVec<'a, T> {
16921703

16931704
// Prevent the inner `Vec<T>` from attempting to deallocate memory.
16941705
#[unsafe_destructor]
1695-
#[experimental]
1706+
#[stable]
16961707
impl<'a, T> Drop for DerefVec<'a, T> {
16971708
fn drop(&mut self) {
16981709
self.x.len = 0;

src/libcore/borrow.rs

+1
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ impl<'a, T, Sized? B> Cow<'a, T, B> where B: ToOwned<T> {
191191
}
192192
}
193193

194+
#[stable]
194195
impl<'a, T, Sized? B> Deref for Cow<'a, T, B> where B: ToOwned<T> {
195196
type Target = B;
196197

src/libcore/cell.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ pub struct Ref<'b, T:'b> {
419419
_borrow: BorrowRef<'b>,
420420
}
421421

422-
#[unstable = "waiting for `Deref` to become stable"]
422+
#[stable]
423423
impl<'b, T> Deref for Ref<'b, T> {
424424
type Target = T;
425425

@@ -477,7 +477,7 @@ pub struct RefMut<'b, T:'b> {
477477
_borrow: BorrowRefMut<'b>,
478478
}
479479

480-
#[unstable = "waiting for `Deref` to become stable"]
480+
#[stable]
481481
impl<'b, T> Deref for RefMut<'b, T> {
482482
type Target = T;
483483

@@ -487,7 +487,7 @@ impl<'b, T> Deref for RefMut<'b, T> {
487487
}
488488
}
489489

490-
#[unstable = "waiting for `DerefMut` to become stable"]
490+
#[stable]
491491
impl<'b, T> DerefMut for RefMut<'b, T> {
492492
#[inline]
493493
fn deref_mut<'a>(&'a mut self) -> &'a mut T {

src/libcore/char.rs

+2
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ pub struct EscapeUnicode {
314314
}
315315

316316
#[derive(Clone)]
317+
#[unstable]
317318
enum EscapeUnicodeState {
318319
Backslash,
319320
Type,
@@ -375,6 +376,7 @@ pub struct EscapeDefault {
375376
}
376377

377378
#[derive(Clone)]
379+
#[unstable]
378380
enum EscapeDefaultState {
379381
Backslash(char),
380382
Char(char),

src/libcore/iter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2401,7 +2401,7 @@ impl<A, St, F> Unfold<A, St, F> where F: FnMut(&mut St) -> Option<A> {
24012401
}
24022402
}
24032403

2404-
#[experimental]
2404+
#[stable]
24052405
impl<A, St, F> Iterator for Unfold<A, St, F> where F: FnMut(&mut St) -> Option<A> {
24062406
type Item = A;
24072407

0 commit comments

Comments
 (0)