1
Fork 0

rollup merge of #20565: alexcrichton/missing-stability

Conflicts:
	src/libstd/sync/mpsc/mod.rs
This commit is contained in:
Alex Crichton 2015-01-05 18:41:55 -08:00
commit 83c890b454
8 changed files with 24 additions and 46 deletions

View file

@ -50,6 +50,7 @@
//! is the same as `&[u8]`. //! is the same as `&[u8]`.
#![doc(primitive = "str")] #![doc(primitive = "str")]
#![stable]
use self::RecompositionState::*; use self::RecompositionState::*;
use self::DecompositionType::*; use self::DecompositionType::*;
@ -407,6 +408,7 @@ Section: Trait implementations
*/ */
/// Any string that can be represented as a slice. /// Any string that can be represented as a slice.
#[stable]
pub trait StrExt for Sized?: ops::Slice<uint, str> { pub trait StrExt for Sized?: ops::Slice<uint, str> {
/// Escapes each char in `s` with `char::escape_default`. /// Escapes each char in `s` with `char::escape_default`.
#[unstable = "return type may change to be an iterator"] #[unstable = "return type may change to be an iterator"]
@ -1346,6 +1348,7 @@ pub trait StrExt for Sized?: ops::Slice<uint, str> {
} }
} }
#[stable]
impl StrExt for str {} impl StrExt for str {}
#[cfg(test)] #[cfg(test)]

View file

@ -86,7 +86,7 @@ pub struct AtomicBool {
unsafe impl Sync for AtomicBool {} unsafe impl Sync for AtomicBool {}
/// A signed integer type which can be safely shared between threads. /// A signed integer type which can be safely shared between threads.
#[stable] #[unstable = "awaiting int/uint conventions, may be renamed"]
pub struct AtomicInt { pub struct AtomicInt {
v: UnsafeCell<int>, v: UnsafeCell<int>,
} }
@ -94,7 +94,7 @@ pub struct AtomicInt {
unsafe impl Sync for AtomicInt {} unsafe impl Sync for AtomicInt {}
/// An unsigned integer type which can be safely shared between threads. /// An unsigned integer type which can be safely shared between threads.
#[stable] #[unstable = "awaiting int/uint conventions, may be renamed"]
pub struct AtomicUint { pub struct AtomicUint {
v: UnsafeCell<uint>, v: UnsafeCell<uint>,
} }
@ -146,28 +146,18 @@ pub enum Ordering {
} }
/// An `AtomicBool` initialized to `false`. /// An `AtomicBool` initialized to `false`.
#[unstable = "may be renamed, pending conventions for static initalizers"] #[stable]
pub const ATOMIC_BOOL_INIT: AtomicBool = pub const ATOMIC_BOOL_INIT: AtomicBool =
AtomicBool { v: UnsafeCell { value: 0 } }; AtomicBool { v: UnsafeCell { value: 0 } };
/// An `AtomicInt` initialized to `0`. /// An `AtomicInt` initialized to `0`.
#[unstable = "may be renamed, pending conventions for static initalizers"] #[unstable = "awaiting int/uint conventions, may be renamed"]
pub const ATOMIC_INT_INIT: AtomicInt = pub const ATOMIC_INT_INIT: AtomicInt =
AtomicInt { v: UnsafeCell { value: 0 } }; AtomicInt { v: UnsafeCell { value: 0 } };
/// An `AtomicUint` initialized to `0`. /// An `AtomicUint` initialized to `0`.
#[unstable = "may be renamed, pending conventions for static initalizers"] #[unstable = "awaiting int/uint conventions, may be renamed"]
pub const ATOMIC_UINT_INIT: AtomicUint = pub const ATOMIC_UINT_INIT: AtomicUint =
AtomicUint { v: UnsafeCell { value: 0, } }; AtomicUint { v: UnsafeCell { value: 0, } };
/// Deprecated
#[deprecated = "renamed to ATOMIC_BOOL_INIT"]
pub const INIT_ATOMIC_BOOL: AtomicBool = ATOMIC_BOOL_INIT;
/// Deprecated
#[deprecated = "renamed to ATOMIC_INT_INIT"]
pub const INIT_ATOMIC_INT: AtomicInt = ATOMIC_INT_INIT;
/// Deprecated
#[deprecated = "renamed to ATOMIC_UINT_INIT"]
pub const INIT_ATOMIC_UINT: AtomicUint = ATOMIC_UINT_INIT;
// NB: Needs to be -1 (0b11111111...) to make fetch_nand work correctly // NB: Needs to be -1 (0b11111111...) to make fetch_nand work correctly
const UINT_TRUE: uint = -1; const UINT_TRUE: uint = -1;
@ -413,6 +403,7 @@ impl AtomicBool {
} }
} }
#[unstable = "awaiting int/uint conventions, types may change"]
impl AtomicInt { impl AtomicInt {
/// Creates a new `AtomicInt`. /// Creates a new `AtomicInt`.
/// ///
@ -424,7 +415,6 @@ impl AtomicInt {
/// let atomic_forty_two = AtomicInt::new(42); /// let atomic_forty_two = AtomicInt::new(42);
/// ``` /// ```
#[inline] #[inline]
#[stable]
pub fn new(v: int) -> AtomicInt { pub fn new(v: int) -> AtomicInt {
AtomicInt {v: UnsafeCell::new(v)} AtomicInt {v: UnsafeCell::new(v)}
} }
@ -447,7 +437,6 @@ impl AtomicInt {
/// let value = some_int.load(Ordering::Relaxed); /// let value = some_int.load(Ordering::Relaxed);
/// ``` /// ```
#[inline] #[inline]
#[stable]
pub fn load(&self, order: Ordering) -> int { pub fn load(&self, order: Ordering) -> int {
unsafe { atomic_load(self.v.get() as *const int, order) } unsafe { atomic_load(self.v.get() as *const int, order) }
} }
@ -470,7 +459,6 @@ impl AtomicInt {
/// ///
/// Panics if `order` is `Acquire` or `AcqRel`. /// Panics if `order` is `Acquire` or `AcqRel`.
#[inline] #[inline]
#[stable]
pub fn store(&self, val: int, order: Ordering) { pub fn store(&self, val: int, order: Ordering) {
unsafe { atomic_store(self.v.get(), val, order); } unsafe { atomic_store(self.v.get(), val, order); }
} }
@ -489,7 +477,6 @@ impl AtomicInt {
/// let value = some_int.swap(10, Ordering::Relaxed); /// let value = some_int.swap(10, Ordering::Relaxed);
/// ``` /// ```
#[inline] #[inline]
#[stable]
pub fn swap(&self, val: int, order: Ordering) -> int { pub fn swap(&self, val: int, order: Ordering) -> int {
unsafe { atomic_swap(self.v.get(), val, order) } unsafe { atomic_swap(self.v.get(), val, order) }
} }
@ -511,7 +498,6 @@ impl AtomicInt {
/// let value = some_int.compare_and_swap(5, 10, Ordering::Relaxed); /// let value = some_int.compare_and_swap(5, 10, Ordering::Relaxed);
/// ``` /// ```
#[inline] #[inline]
#[stable]
pub fn compare_and_swap(&self, old: int, new: int, order: Ordering) -> int { pub fn compare_and_swap(&self, old: int, new: int, order: Ordering) -> int {
unsafe { atomic_compare_and_swap(self.v.get(), old, new, order) } unsafe { atomic_compare_and_swap(self.v.get(), old, new, order) }
} }
@ -528,7 +514,6 @@ impl AtomicInt {
/// assert_eq!(10, foo.load(Ordering::SeqCst)); /// assert_eq!(10, foo.load(Ordering::SeqCst));
/// ``` /// ```
#[inline] #[inline]
#[stable]
pub fn fetch_add(&self, val: int, order: Ordering) -> int { pub fn fetch_add(&self, val: int, order: Ordering) -> int {
unsafe { atomic_add(self.v.get(), val, order) } unsafe { atomic_add(self.v.get(), val, order) }
} }
@ -545,7 +530,6 @@ impl AtomicInt {
/// assert_eq!(-10, foo.load(Ordering::SeqCst)); /// assert_eq!(-10, foo.load(Ordering::SeqCst));
/// ``` /// ```
#[inline] #[inline]
#[stable]
pub fn fetch_sub(&self, val: int, order: Ordering) -> int { pub fn fetch_sub(&self, val: int, order: Ordering) -> int {
unsafe { atomic_sub(self.v.get(), val, order) } unsafe { atomic_sub(self.v.get(), val, order) }
} }
@ -561,7 +545,6 @@ impl AtomicInt {
/// assert_eq!(0b101101, foo.fetch_and(0b110011, Ordering::SeqCst)); /// assert_eq!(0b101101, foo.fetch_and(0b110011, Ordering::SeqCst));
/// assert_eq!(0b100001, foo.load(Ordering::SeqCst)); /// assert_eq!(0b100001, foo.load(Ordering::SeqCst));
#[inline] #[inline]
#[stable]
pub fn fetch_and(&self, val: int, order: Ordering) -> int { pub fn fetch_and(&self, val: int, order: Ordering) -> int {
unsafe { atomic_and(self.v.get(), val, order) } unsafe { atomic_and(self.v.get(), val, order) }
} }
@ -577,7 +560,6 @@ impl AtomicInt {
/// assert_eq!(0b101101, foo.fetch_or(0b110011, Ordering::SeqCst)); /// assert_eq!(0b101101, foo.fetch_or(0b110011, Ordering::SeqCst));
/// assert_eq!(0b111111, foo.load(Ordering::SeqCst)); /// assert_eq!(0b111111, foo.load(Ordering::SeqCst));
#[inline] #[inline]
#[stable]
pub fn fetch_or(&self, val: int, order: Ordering) -> int { pub fn fetch_or(&self, val: int, order: Ordering) -> int {
unsafe { atomic_or(self.v.get(), val, order) } unsafe { atomic_or(self.v.get(), val, order) }
} }
@ -593,12 +575,12 @@ impl AtomicInt {
/// assert_eq!(0b101101, foo.fetch_xor(0b110011, Ordering::SeqCst)); /// assert_eq!(0b101101, foo.fetch_xor(0b110011, Ordering::SeqCst));
/// assert_eq!(0b011110, foo.load(Ordering::SeqCst)); /// assert_eq!(0b011110, foo.load(Ordering::SeqCst));
#[inline] #[inline]
#[stable]
pub fn fetch_xor(&self, val: int, order: Ordering) -> int { pub fn fetch_xor(&self, val: int, order: Ordering) -> int {
unsafe { atomic_xor(self.v.get(), val, order) } unsafe { atomic_xor(self.v.get(), val, order) }
} }
} }
#[unstable = "awaiting int/uint conventions, types may change"]
impl AtomicUint { impl AtomicUint {
/// Creates a new `AtomicUint`. /// Creates a new `AtomicUint`.
/// ///
@ -610,7 +592,6 @@ impl AtomicUint {
/// let atomic_forty_two = AtomicUint::new(42u); /// let atomic_forty_two = AtomicUint::new(42u);
/// ``` /// ```
#[inline] #[inline]
#[stable]
pub fn new(v: uint) -> AtomicUint { pub fn new(v: uint) -> AtomicUint {
AtomicUint { v: UnsafeCell::new(v) } AtomicUint { v: UnsafeCell::new(v) }
} }
@ -633,7 +614,6 @@ impl AtomicUint {
/// let value = some_uint.load(Ordering::Relaxed); /// let value = some_uint.load(Ordering::Relaxed);
/// ``` /// ```
#[inline] #[inline]
#[stable]
pub fn load(&self, order: Ordering) -> uint { pub fn load(&self, order: Ordering) -> uint {
unsafe { atomic_load(self.v.get() as *const uint, order) } unsafe { atomic_load(self.v.get() as *const uint, order) }
} }
@ -656,7 +636,6 @@ impl AtomicUint {
/// ///
/// Panics if `order` is `Acquire` or `AcqRel`. /// Panics if `order` is `Acquire` or `AcqRel`.
#[inline] #[inline]
#[stable]
pub fn store(&self, val: uint, order: Ordering) { pub fn store(&self, val: uint, order: Ordering) {
unsafe { atomic_store(self.v.get(), val, order); } unsafe { atomic_store(self.v.get(), val, order); }
} }
@ -675,7 +654,6 @@ impl AtomicUint {
/// let value = some_uint.swap(10, Ordering::Relaxed); /// let value = some_uint.swap(10, Ordering::Relaxed);
/// ``` /// ```
#[inline] #[inline]
#[stable]
pub fn swap(&self, val: uint, order: Ordering) -> uint { pub fn swap(&self, val: uint, order: Ordering) -> uint {
unsafe { atomic_swap(self.v.get(), val, order) } unsafe { atomic_swap(self.v.get(), val, order) }
} }
@ -697,7 +675,6 @@ impl AtomicUint {
/// let value = some_uint.compare_and_swap(5, 10, Ordering::Relaxed); /// let value = some_uint.compare_and_swap(5, 10, Ordering::Relaxed);
/// ``` /// ```
#[inline] #[inline]
#[stable]
pub fn compare_and_swap(&self, old: uint, new: uint, order: Ordering) -> uint { pub fn compare_and_swap(&self, old: uint, new: uint, order: Ordering) -> uint {
unsafe { atomic_compare_and_swap(self.v.get(), old, new, order) } unsafe { atomic_compare_and_swap(self.v.get(), old, new, order) }
} }
@ -714,7 +691,6 @@ impl AtomicUint {
/// assert_eq!(10, foo.load(Ordering::SeqCst)); /// assert_eq!(10, foo.load(Ordering::SeqCst));
/// ``` /// ```
#[inline] #[inline]
#[stable]
pub fn fetch_add(&self, val: uint, order: Ordering) -> uint { pub fn fetch_add(&self, val: uint, order: Ordering) -> uint {
unsafe { atomic_add(self.v.get(), val, order) } unsafe { atomic_add(self.v.get(), val, order) }
} }
@ -731,7 +707,6 @@ impl AtomicUint {
/// assert_eq!(0, foo.load(Ordering::SeqCst)); /// assert_eq!(0, foo.load(Ordering::SeqCst));
/// ``` /// ```
#[inline] #[inline]
#[stable]
pub fn fetch_sub(&self, val: uint, order: Ordering) -> uint { pub fn fetch_sub(&self, val: uint, order: Ordering) -> uint {
unsafe { atomic_sub(self.v.get(), val, order) } unsafe { atomic_sub(self.v.get(), val, order) }
} }
@ -747,7 +722,6 @@ impl AtomicUint {
/// assert_eq!(0b101101, foo.fetch_and(0b110011, Ordering::SeqCst)); /// assert_eq!(0b101101, foo.fetch_and(0b110011, Ordering::SeqCst));
/// assert_eq!(0b100001, foo.load(Ordering::SeqCst)); /// assert_eq!(0b100001, foo.load(Ordering::SeqCst));
#[inline] #[inline]
#[stable]
pub fn fetch_and(&self, val: uint, order: Ordering) -> uint { pub fn fetch_and(&self, val: uint, order: Ordering) -> uint {
unsafe { atomic_and(self.v.get(), val, order) } unsafe { atomic_and(self.v.get(), val, order) }
} }
@ -763,7 +737,6 @@ impl AtomicUint {
/// assert_eq!(0b101101, foo.fetch_or(0b110011, Ordering::SeqCst)); /// assert_eq!(0b101101, foo.fetch_or(0b110011, Ordering::SeqCst));
/// assert_eq!(0b111111, foo.load(Ordering::SeqCst)); /// assert_eq!(0b111111, foo.load(Ordering::SeqCst));
#[inline] #[inline]
#[stable]
pub fn fetch_or(&self, val: uint, order: Ordering) -> uint { pub fn fetch_or(&self, val: uint, order: Ordering) -> uint {
unsafe { atomic_or(self.v.get(), val, order) } unsafe { atomic_or(self.v.get(), val, order) }
} }
@ -779,7 +752,6 @@ impl AtomicUint {
/// assert_eq!(0b101101, foo.fetch_xor(0b110011, Ordering::SeqCst)); /// assert_eq!(0b101101, foo.fetch_xor(0b110011, Ordering::SeqCst));
/// assert_eq!(0b011110, foo.load(Ordering::SeqCst)); /// assert_eq!(0b011110, foo.load(Ordering::SeqCst));
#[inline] #[inline]
#[stable]
pub fn fetch_xor(&self, val: uint, order: Ordering) -> uint { pub fn fetch_xor(&self, val: uint, order: Ordering) -> uint {
unsafe { atomic_xor(self.v.get(), val, order) } unsafe { atomic_xor(self.v.get(), val, order) }
} }

View file

@ -144,6 +144,7 @@ Section: Creating a string
/// Errors which can occur when attempting to interpret a byte slice as a `str`. /// Errors which can occur when attempting to interpret a byte slice as a `str`.
#[derive(Copy, Eq, PartialEq, Clone)] #[derive(Copy, Eq, PartialEq, Clone)]
#[unstable = "error enumeration recently added and definitions may be refined"]
pub enum Utf8Error { pub enum Utf8Error {
/// An invalid byte was detected at the byte offset given. /// An invalid byte was detected at the byte offset given.
/// ///
@ -167,6 +168,7 @@ pub enum Utf8Error {
/// ///
/// Returns `Err` if the slice is not utf-8 with a description as to why the /// Returns `Err` if the slice is not utf-8 with a description as to why the
/// provided slice is not utf-8. /// provided slice is not utf-8.
#[stable]
pub fn from_utf8(v: &[u8]) -> Result<&str, Utf8Error> { pub fn from_utf8(v: &[u8]) -> Result<&str, Utf8Error> {
try!(run_utf8_validation_iterator(&mut v.iter())); try!(run_utf8_validation_iterator(&mut v.iter()));
Ok(unsafe { from_utf8_unchecked(v) }) Ok(unsafe { from_utf8_unchecked(v) })
@ -249,6 +251,7 @@ Section: Iterators
/// ///
/// Created with the method `.chars()`. /// Created with the method `.chars()`.
#[derive(Clone, Copy)] #[derive(Clone, Copy)]
#[stable]
pub struct Chars<'a> { pub struct Chars<'a> {
iter: slice::Iter<'a, u8> iter: slice::Iter<'a, u8>
} }
@ -858,6 +861,7 @@ impl Searcher {
/// An iterator over the start and end indices of the matches of a /// An iterator over the start and end indices of the matches of a
/// substring within a larger string /// substring within a larger string
#[derive(Clone)] #[derive(Clone)]
#[unstable = "type may be removed"]
pub struct MatchIndices<'a> { pub struct MatchIndices<'a> {
// constants // constants
haystack: &'a str, haystack: &'a str,
@ -868,7 +872,7 @@ pub struct MatchIndices<'a> {
/// An iterator over the substrings of a string separated by a given /// An iterator over the substrings of a string separated by a given
/// search string /// search string
#[derive(Clone)] #[derive(Clone)]
#[unstable = "Type might get removed"] #[unstable = "type may be removed"]
pub struct SplitStr<'a> { pub struct SplitStr<'a> {
it: MatchIndices<'a>, it: MatchIndices<'a>,
last_end: uint, last_end: uint,
@ -1068,8 +1072,7 @@ const TAG_CONT_U8: u8 = 0b1000_0000u8;
Section: Trait implementations Section: Trait implementations
*/ */
#[allow(missing_docs)] mod traits {
pub mod traits {
use cmp::{Ordering, Ord, PartialEq, PartialOrd, Eq}; use cmp::{Ordering, Ord, PartialEq, PartialOrd, Eq};
use cmp::Ordering::{Less, Equal, Greater}; use cmp::Ordering::{Less, Equal, Greater};
use iter::IteratorExt; use iter::IteratorExt;

View file

@ -95,7 +95,7 @@
//! and `format!`, also available to all Rust code. //! and `format!`, also available to all Rust code.
#![crate_name = "std"] #![crate_name = "std"]
#![unstable] #![stable]
#![crate_type = "rlib"] #![crate_type = "rlib"]
#![crate_type = "dylib"] #![crate_type = "dylib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",

View file

@ -35,5 +35,7 @@
//! pervasive that it would be obnoxious to import for every use, particularly //! pervasive that it would be obnoxious to import for every use, particularly
//! those that define methods on primitive types. //! those that define methods on primitive types.
#![stable]
#[stable] #[stable]
pub mod v1; pub mod v1;

View file

@ -15,7 +15,7 @@
//! and/or blocking at all, but rather provide the necessary tools to build //! and/or blocking at all, but rather provide the necessary tools to build
//! other types of concurrent primitives. //! other types of concurrent primitives.
#![experimental] #![stable]
pub use alloc::arc::{Arc, Weak}; pub use alloc::arc::{Arc, Weak};
pub use core::atomic; pub use core::atomic;

View file

@ -162,6 +162,8 @@
//! } //! }
//! ``` //! ```
#![stable]
// A description of how Rust's channel implementation works // A description of how Rust's channel implementation works
// //
// Channels are supposed to be the basic building block for all other // Channels are supposed to be the basic building block for all other
@ -589,8 +591,8 @@ impl<T: Send> Sender<T> {
/// drop(rx); /// drop(rx);
/// assert_eq!(tx.send_opt(1), Err(1)); /// assert_eq!(tx.send_opt(1), Err(1));
/// ``` /// ```
#[unstable = "this function may be renamed to send() in the future"] #[stable]
pub fn send_opt(&self, t: T) -> Result<(), T> { pub fn send(&self, t: T) -> Result<(), SendError<T>> {
let (new_inner, ret) = match *unsafe { self.inner() } { let (new_inner, ret) = match *unsafe { self.inner() } {
Flavor::Oneshot(ref p) => { Flavor::Oneshot(ref p) => {
unsafe { unsafe {

View file

@ -121,10 +121,6 @@ impl Once {
unsafe { self.mutex.destroy() } unsafe { self.mutex.destroy() }
} }
} }
/// Deprecated
#[deprecated = "renamed to `call_once`"]
pub fn doit<F>(&'static self, f: F) where F: FnOnce() { self.call_once(f) }
} }
#[cfg(test)] #[cfg(test)]