Skip to content

Commit 83c890b

Browse files
committed
rollup merge of #20565: alexcrichton/missing-stability
Conflicts: src/libstd/sync/mpsc/mod.rs
2 parents 59bbf56 + 4236c52 commit 83c890b

File tree

8 files changed

+24
-46
lines changed

8 files changed

+24
-46
lines changed

src/libcollections/str.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
//! is the same as `&[u8]`.
5151
5252
#![doc(primitive = "str")]
53+
#![stable]
5354

5455
use self::RecompositionState::*;
5556
use self::DecompositionType::*;
@@ -407,6 +408,7 @@ Section: Trait implementations
407408
*/
408409

409410
/// Any string that can be represented as a slice.
411+
#[stable]
410412
pub trait StrExt for Sized?: ops::Slice<uint, str> {
411413
/// Escapes each char in `s` with `char::escape_default`.
412414
#[unstable = "return type may change to be an iterator"]
@@ -1346,6 +1348,7 @@ pub trait StrExt for Sized?: ops::Slice<uint, str> {
13461348
}
13471349
}
13481350

1351+
#[stable]
13491352
impl StrExt for str {}
13501353

13511354
#[cfg(test)]

src/libcore/atomic.rs

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ pub struct AtomicBool {
8686
unsafe impl Sync for AtomicBool {}
8787

8888
/// A signed integer type which can be safely shared between threads.
89-
#[stable]
89+
#[unstable = "awaiting int/uint conventions, may be renamed"]
9090
pub struct AtomicInt {
9191
v: UnsafeCell<int>,
9292
}
9393

9494
unsafe impl Sync for AtomicInt {}
9595

9696
/// An unsigned integer type which can be safely shared between threads.
97-
#[stable]
97+
#[unstable = "awaiting int/uint conventions, may be renamed"]
9898
pub struct AtomicUint {
9999
v: UnsafeCell<uint>,
100100
}
@@ -146,28 +146,18 @@ pub enum Ordering {
146146
}
147147

148148
/// An `AtomicBool` initialized to `false`.
149-
#[unstable = "may be renamed, pending conventions for static initalizers"]
149+
#[stable]
150150
pub const ATOMIC_BOOL_INIT: AtomicBool =
151151
AtomicBool { v: UnsafeCell { value: 0 } };
152152
/// An `AtomicInt` initialized to `0`.
153-
#[unstable = "may be renamed, pending conventions for static initalizers"]
153+
#[unstable = "awaiting int/uint conventions, may be renamed"]
154154
pub const ATOMIC_INT_INIT: AtomicInt =
155155
AtomicInt { v: UnsafeCell { value: 0 } };
156156
/// An `AtomicUint` initialized to `0`.
157-
#[unstable = "may be renamed, pending conventions for static initalizers"]
157+
#[unstable = "awaiting int/uint conventions, may be renamed"]
158158
pub const ATOMIC_UINT_INIT: AtomicUint =
159159
AtomicUint { v: UnsafeCell { value: 0, } };
160160

161-
/// Deprecated
162-
#[deprecated = "renamed to ATOMIC_BOOL_INIT"]
163-
pub const INIT_ATOMIC_BOOL: AtomicBool = ATOMIC_BOOL_INIT;
164-
/// Deprecated
165-
#[deprecated = "renamed to ATOMIC_INT_INIT"]
166-
pub const INIT_ATOMIC_INT: AtomicInt = ATOMIC_INT_INIT;
167-
/// Deprecated
168-
#[deprecated = "renamed to ATOMIC_UINT_INIT"]
169-
pub const INIT_ATOMIC_UINT: AtomicUint = ATOMIC_UINT_INIT;
170-
171161
// NB: Needs to be -1 (0b11111111...) to make fetch_nand work correctly
172162
const UINT_TRUE: uint = -1;
173163

@@ -413,6 +403,7 @@ impl AtomicBool {
413403
}
414404
}
415405

406+
#[unstable = "awaiting int/uint conventions, types may change"]
416407
impl AtomicInt {
417408
/// Creates a new `AtomicInt`.
418409
///
@@ -424,7 +415,6 @@ impl AtomicInt {
424415
/// let atomic_forty_two = AtomicInt::new(42);
425416
/// ```
426417
#[inline]
427-
#[stable]
428418
pub fn new(v: int) -> AtomicInt {
429419
AtomicInt {v: UnsafeCell::new(v)}
430420
}
@@ -447,7 +437,6 @@ impl AtomicInt {
447437
/// let value = some_int.load(Ordering::Relaxed);
448438
/// ```
449439
#[inline]
450-
#[stable]
451440
pub fn load(&self, order: Ordering) -> int {
452441
unsafe { atomic_load(self.v.get() as *const int, order) }
453442
}
@@ -470,7 +459,6 @@ impl AtomicInt {
470459
///
471460
/// Panics if `order` is `Acquire` or `AcqRel`.
472461
#[inline]
473-
#[stable]
474462
pub fn store(&self, val: int, order: Ordering) {
475463
unsafe { atomic_store(self.v.get(), val, order); }
476464
}
@@ -489,7 +477,6 @@ impl AtomicInt {
489477
/// let value = some_int.swap(10, Ordering::Relaxed);
490478
/// ```
491479
#[inline]
492-
#[stable]
493480
pub fn swap(&self, val: int, order: Ordering) -> int {
494481
unsafe { atomic_swap(self.v.get(), val, order) }
495482
}
@@ -511,7 +498,6 @@ impl AtomicInt {
511498
/// let value = some_int.compare_and_swap(5, 10, Ordering::Relaxed);
512499
/// ```
513500
#[inline]
514-
#[stable]
515501
pub fn compare_and_swap(&self, old: int, new: int, order: Ordering) -> int {
516502
unsafe { atomic_compare_and_swap(self.v.get(), old, new, order) }
517503
}
@@ -528,7 +514,6 @@ impl AtomicInt {
528514
/// assert_eq!(10, foo.load(Ordering::SeqCst));
529515
/// ```
530516
#[inline]
531-
#[stable]
532517
pub fn fetch_add(&self, val: int, order: Ordering) -> int {
533518
unsafe { atomic_add(self.v.get(), val, order) }
534519
}
@@ -545,7 +530,6 @@ impl AtomicInt {
545530
/// assert_eq!(-10, foo.load(Ordering::SeqCst));
546531
/// ```
547532
#[inline]
548-
#[stable]
549533
pub fn fetch_sub(&self, val: int, order: Ordering) -> int {
550534
unsafe { atomic_sub(self.v.get(), val, order) }
551535
}
@@ -561,7 +545,6 @@ impl AtomicInt {
561545
/// assert_eq!(0b101101, foo.fetch_and(0b110011, Ordering::SeqCst));
562546
/// assert_eq!(0b100001, foo.load(Ordering::SeqCst));
563547
#[inline]
564-
#[stable]
565548
pub fn fetch_and(&self, val: int, order: Ordering) -> int {
566549
unsafe { atomic_and(self.v.get(), val, order) }
567550
}
@@ -577,7 +560,6 @@ impl AtomicInt {
577560
/// assert_eq!(0b101101, foo.fetch_or(0b110011, Ordering::SeqCst));
578561
/// assert_eq!(0b111111, foo.load(Ordering::SeqCst));
579562
#[inline]
580-
#[stable]
581563
pub fn fetch_or(&self, val: int, order: Ordering) -> int {
582564
unsafe { atomic_or(self.v.get(), val, order) }
583565
}
@@ -593,12 +575,12 @@ impl AtomicInt {
593575
/// assert_eq!(0b101101, foo.fetch_xor(0b110011, Ordering::SeqCst));
594576
/// assert_eq!(0b011110, foo.load(Ordering::SeqCst));
595577
#[inline]
596-
#[stable]
597578
pub fn fetch_xor(&self, val: int, order: Ordering) -> int {
598579
unsafe { atomic_xor(self.v.get(), val, order) }
599580
}
600581
}
601582

583+
#[unstable = "awaiting int/uint conventions, types may change"]
602584
impl AtomicUint {
603585
/// Creates a new `AtomicUint`.
604586
///
@@ -610,7 +592,6 @@ impl AtomicUint {
610592
/// let atomic_forty_two = AtomicUint::new(42u);
611593
/// ```
612594
#[inline]
613-
#[stable]
614595
pub fn new(v: uint) -> AtomicUint {
615596
AtomicUint { v: UnsafeCell::new(v) }
616597
}
@@ -633,7 +614,6 @@ impl AtomicUint {
633614
/// let value = some_uint.load(Ordering::Relaxed);
634615
/// ```
635616
#[inline]
636-
#[stable]
637617
pub fn load(&self, order: Ordering) -> uint {
638618
unsafe { atomic_load(self.v.get() as *const uint, order) }
639619
}
@@ -656,7 +636,6 @@ impl AtomicUint {
656636
///
657637
/// Panics if `order` is `Acquire` or `AcqRel`.
658638
#[inline]
659-
#[stable]
660639
pub fn store(&self, val: uint, order: Ordering) {
661640
unsafe { atomic_store(self.v.get(), val, order); }
662641
}
@@ -675,7 +654,6 @@ impl AtomicUint {
675654
/// let value = some_uint.swap(10, Ordering::Relaxed);
676655
/// ```
677656
#[inline]
678-
#[stable]
679657
pub fn swap(&self, val: uint, order: Ordering) -> uint {
680658
unsafe { atomic_swap(self.v.get(), val, order) }
681659
}
@@ -697,7 +675,6 @@ impl AtomicUint {
697675
/// let value = some_uint.compare_and_swap(5, 10, Ordering::Relaxed);
698676
/// ```
699677
#[inline]
700-
#[stable]
701678
pub fn compare_and_swap(&self, old: uint, new: uint, order: Ordering) -> uint {
702679
unsafe { atomic_compare_and_swap(self.v.get(), old, new, order) }
703680
}
@@ -714,7 +691,6 @@ impl AtomicUint {
714691
/// assert_eq!(10, foo.load(Ordering::SeqCst));
715692
/// ```
716693
#[inline]
717-
#[stable]
718694
pub fn fetch_add(&self, val: uint, order: Ordering) -> uint {
719695
unsafe { atomic_add(self.v.get(), val, order) }
720696
}
@@ -731,7 +707,6 @@ impl AtomicUint {
731707
/// assert_eq!(0, foo.load(Ordering::SeqCst));
732708
/// ```
733709
#[inline]
734-
#[stable]
735710
pub fn fetch_sub(&self, val: uint, order: Ordering) -> uint {
736711
unsafe { atomic_sub(self.v.get(), val, order) }
737712
}
@@ -747,7 +722,6 @@ impl AtomicUint {
747722
/// assert_eq!(0b101101, foo.fetch_and(0b110011, Ordering::SeqCst));
748723
/// assert_eq!(0b100001, foo.load(Ordering::SeqCst));
749724
#[inline]
750-
#[stable]
751725
pub fn fetch_and(&self, val: uint, order: Ordering) -> uint {
752726
unsafe { atomic_and(self.v.get(), val, order) }
753727
}
@@ -763,7 +737,6 @@ impl AtomicUint {
763737
/// assert_eq!(0b101101, foo.fetch_or(0b110011, Ordering::SeqCst));
764738
/// assert_eq!(0b111111, foo.load(Ordering::SeqCst));
765739
#[inline]
766-
#[stable]
767740
pub fn fetch_or(&self, val: uint, order: Ordering) -> uint {
768741
unsafe { atomic_or(self.v.get(), val, order) }
769742
}
@@ -779,7 +752,6 @@ impl AtomicUint {
779752
/// assert_eq!(0b101101, foo.fetch_xor(0b110011, Ordering::SeqCst));
780753
/// assert_eq!(0b011110, foo.load(Ordering::SeqCst));
781754
#[inline]
782-
#[stable]
783755
pub fn fetch_xor(&self, val: uint, order: Ordering) -> uint {
784756
unsafe { atomic_xor(self.v.get(), val, order) }
785757
}

src/libcore/str/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ Section: Creating a string
144144

145145
/// Errors which can occur when attempting to interpret a byte slice as a `str`.
146146
#[derive(Copy, Eq, PartialEq, Clone)]
147+
#[unstable = "error enumeration recently added and definitions may be refined"]
147148
pub enum Utf8Error {
148149
/// An invalid byte was detected at the byte offset given.
149150
///
@@ -167,6 +168,7 @@ pub enum Utf8Error {
167168
///
168169
/// Returns `Err` if the slice is not utf-8 with a description as to why the
169170
/// provided slice is not utf-8.
171+
#[stable]
170172
pub fn from_utf8(v: &[u8]) -> Result<&str, Utf8Error> {
171173
try!(run_utf8_validation_iterator(&mut v.iter()));
172174
Ok(unsafe { from_utf8_unchecked(v) })
@@ -249,6 +251,7 @@ Section: Iterators
249251
///
250252
/// Created with the method `.chars()`.
251253
#[derive(Clone, Copy)]
254+
#[stable]
252255
pub struct Chars<'a> {
253256
iter: slice::Iter<'a, u8>
254257
}
@@ -858,6 +861,7 @@ impl Searcher {
858861
/// An iterator over the start and end indices of the matches of a
859862
/// substring within a larger string
860863
#[derive(Clone)]
864+
#[unstable = "type may be removed"]
861865
pub struct MatchIndices<'a> {
862866
// constants
863867
haystack: &'a str,
@@ -868,7 +872,7 @@ pub struct MatchIndices<'a> {
868872
/// An iterator over the substrings of a string separated by a given
869873
/// search string
870874
#[derive(Clone)]
871-
#[unstable = "Type might get removed"]
875+
#[unstable = "type may be removed"]
872876
pub struct SplitStr<'a> {
873877
it: MatchIndices<'a>,
874878
last_end: uint,
@@ -1068,8 +1072,7 @@ const TAG_CONT_U8: u8 = 0b1000_0000u8;
10681072
Section: Trait implementations
10691073
*/
10701074

1071-
#[allow(missing_docs)]
1072-
pub mod traits {
1075+
mod traits {
10731076
use cmp::{Ordering, Ord, PartialEq, PartialOrd, Eq};
10741077
use cmp::Ordering::{Less, Equal, Greater};
10751078
use iter::IteratorExt;

src/libstd/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
//! and `format!`, also available to all Rust code.
9696
9797
#![crate_name = "std"]
98-
#![unstable]
98+
#![stable]
9999
#![crate_type = "rlib"]
100100
#![crate_type = "dylib"]
101101
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",

src/libstd/prelude/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,7 @@
3535
//! pervasive that it would be obnoxious to import for every use, particularly
3636
//! those that define methods on primitive types.
3737
38+
#![stable]
39+
3840
#[stable]
3941
pub mod v1;

src/libstd/sync/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//! and/or blocking at all, but rather provide the necessary tools to build
1616
//! other types of concurrent primitives.
1717
18-
#![experimental]
18+
#![stable]
1919

2020
pub use alloc::arc::{Arc, Weak};
2121
pub use core::atomic;

src/libstd/sync/mpsc/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@
162162
//! }
163163
//! ```
164164
165+
#![stable]
166+
165167
// A description of how Rust's channel implementation works
166168
//
167169
// Channels are supposed to be the basic building block for all other
@@ -589,8 +591,8 @@ impl<T: Send> Sender<T> {
589591
/// drop(rx);
590592
/// assert_eq!(tx.send_opt(1), Err(1));
591593
/// ```
592-
#[unstable = "this function may be renamed to send() in the future"]
593-
pub fn send_opt(&self, t: T) -> Result<(), T> {
594+
#[stable]
595+
pub fn send(&self, t: T) -> Result<(), SendError<T>> {
594596
let (new_inner, ret) = match *unsafe { self.inner() } {
595597
Flavor::Oneshot(ref p) => {
596598
unsafe {

src/libstd/sync/once.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,6 @@ impl Once {
121121
unsafe { self.mutex.destroy() }
122122
}
123123
}
124-
125-
/// Deprecated
126-
#[deprecated = "renamed to `call_once`"]
127-
pub fn doit<F>(&'static self, f: F) where F: FnOnce() { self.call_once(f) }
128124
}
129125

130126
#[cfg(test)]

0 commit comments

Comments
 (0)