Skip to content

Fix some missing stability tags #20565

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/libcollections/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
//! is the same as `&[u8]`.

#![doc(primitive = "str")]
#![stable]

use self::RecompositionState::*;
use self::DecompositionType::*;
Expand Down Expand Up @@ -401,6 +402,7 @@ Section: Trait implementations
*/

/// Any string that can be represented as a slice.
#[stable]
pub trait StrExt for Sized?: ops::Slice<uint, str> {
/// Escapes each char in `s` with `char::escape_default`.
#[unstable = "return type may change to be an iterator"]
Expand Down Expand Up @@ -1340,6 +1342,7 @@ pub trait StrExt for Sized?: ops::Slice<uint, str> {
}
}

#[stable]
impl StrExt for str {}

#[cfg(test)]
Expand Down
42 changes: 7 additions & 35 deletions src/libcore/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ pub struct AtomicBool {
unsafe impl Sync for AtomicBool {}

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

unsafe impl Sync for AtomicInt {}

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

/// An `AtomicBool` initialized to `false`.
#[unstable = "may be renamed, pending conventions for static initalizers"]
#[stable]
pub const ATOMIC_BOOL_INIT: AtomicBool =
AtomicBool { v: UnsafeCell { value: 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 =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to _un_stabilize AtomicInt/Uint and related names since they'll likely be renamed now.

AtomicInt { v: UnsafeCell { value: 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 =
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
const UINT_TRUE: uint = -1;

Expand Down Expand Up @@ -413,6 +403,7 @@ impl AtomicBool {
}
}

#[unstable = "awaiting int/uint conventions, types may change"]
impl AtomicInt {
/// Creates a new `AtomicInt`.
///
Expand All @@ -424,7 +415,6 @@ impl AtomicInt {
/// let atomic_forty_two = AtomicInt::new(42);
/// ```
#[inline]
#[stable]
pub fn new(v: int) -> AtomicInt {
AtomicInt {v: UnsafeCell::new(v)}
}
Expand All @@ -447,7 +437,6 @@ impl AtomicInt {
/// let value = some_int.load(Ordering::Relaxed);
/// ```
#[inline]
#[stable]
pub fn load(&self, order: Ordering) -> int {
unsafe { atomic_load(self.v.get() as *const int, order) }
}
Expand All @@ -470,7 +459,6 @@ impl AtomicInt {
///
/// Panics if `order` is `Acquire` or `AcqRel`.
#[inline]
#[stable]
pub fn store(&self, val: int, order: Ordering) {
unsafe { atomic_store(self.v.get(), val, order); }
}
Expand All @@ -489,7 +477,6 @@ impl AtomicInt {
/// let value = some_int.swap(10, Ordering::Relaxed);
/// ```
#[inline]
#[stable]
pub fn swap(&self, val: int, order: Ordering) -> int {
unsafe { atomic_swap(self.v.get(), val, order) }
}
Expand All @@ -511,7 +498,6 @@ impl AtomicInt {
/// let value = some_int.compare_and_swap(5, 10, Ordering::Relaxed);
/// ```
#[inline]
#[stable]
pub fn compare_and_swap(&self, old: int, new: int, order: Ordering) -> int {
unsafe { atomic_compare_and_swap(self.v.get(), old, new, order) }
}
Expand All @@ -528,7 +514,6 @@ impl AtomicInt {
/// assert_eq!(10, foo.load(Ordering::SeqCst));
/// ```
#[inline]
#[stable]
pub fn fetch_add(&self, val: int, order: Ordering) -> int {
unsafe { atomic_add(self.v.get(), val, order) }
}
Expand All @@ -545,7 +530,6 @@ impl AtomicInt {
/// assert_eq!(-10, foo.load(Ordering::SeqCst));
/// ```
#[inline]
#[stable]
pub fn fetch_sub(&self, val: int, order: Ordering) -> int {
unsafe { atomic_sub(self.v.get(), val, order) }
}
Expand All @@ -561,7 +545,6 @@ impl AtomicInt {
/// assert_eq!(0b101101, foo.fetch_and(0b110011, Ordering::SeqCst));
/// assert_eq!(0b100001, foo.load(Ordering::SeqCst));
#[inline]
#[stable]
pub fn fetch_and(&self, val: int, order: Ordering) -> int {
unsafe { atomic_and(self.v.get(), val, order) }
}
Expand All @@ -577,7 +560,6 @@ impl AtomicInt {
/// assert_eq!(0b101101, foo.fetch_or(0b110011, Ordering::SeqCst));
/// assert_eq!(0b111111, foo.load(Ordering::SeqCst));
#[inline]
#[stable]
pub fn fetch_or(&self, val: int, order: Ordering) -> int {
unsafe { atomic_or(self.v.get(), val, order) }
}
Expand All @@ -593,12 +575,12 @@ impl AtomicInt {
/// assert_eq!(0b101101, foo.fetch_xor(0b110011, Ordering::SeqCst));
/// assert_eq!(0b011110, foo.load(Ordering::SeqCst));
#[inline]
#[stable]
pub fn fetch_xor(&self, val: int, order: Ordering) -> int {
unsafe { atomic_xor(self.v.get(), val, order) }
}
}

#[unstable = "awaiting int/uint conventions, types may change"]
impl AtomicUint {
/// Creates a new `AtomicUint`.
///
Expand All @@ -610,7 +592,6 @@ impl AtomicUint {
/// let atomic_forty_two = AtomicUint::new(42u);
/// ```
#[inline]
#[stable]
pub fn new(v: uint) -> AtomicUint {
AtomicUint { v: UnsafeCell::new(v) }
}
Expand All @@ -633,7 +614,6 @@ impl AtomicUint {
/// let value = some_uint.load(Ordering::Relaxed);
/// ```
#[inline]
#[stable]
pub fn load(&self, order: Ordering) -> uint {
unsafe { atomic_load(self.v.get() as *const uint, order) }
}
Expand All @@ -656,7 +636,6 @@ impl AtomicUint {
///
/// Panics if `order` is `Acquire` or `AcqRel`.
#[inline]
#[stable]
pub fn store(&self, val: uint, order: Ordering) {
unsafe { atomic_store(self.v.get(), val, order); }
}
Expand All @@ -675,7 +654,6 @@ impl AtomicUint {
/// let value = some_uint.swap(10, Ordering::Relaxed);
/// ```
#[inline]
#[stable]
pub fn swap(&self, val: uint, order: Ordering) -> uint {
unsafe { atomic_swap(self.v.get(), val, order) }
}
Expand All @@ -697,7 +675,6 @@ impl AtomicUint {
/// let value = some_uint.compare_and_swap(5, 10, Ordering::Relaxed);
/// ```
#[inline]
#[stable]
pub fn compare_and_swap(&self, old: uint, new: uint, order: Ordering) -> uint {
unsafe { atomic_compare_and_swap(self.v.get(), old, new, order) }
}
Expand All @@ -714,7 +691,6 @@ impl AtomicUint {
/// assert_eq!(10, foo.load(Ordering::SeqCst));
/// ```
#[inline]
#[stable]
pub fn fetch_add(&self, val: uint, order: Ordering) -> uint {
unsafe { atomic_add(self.v.get(), val, order) }
}
Expand All @@ -731,7 +707,6 @@ impl AtomicUint {
/// assert_eq!(0, foo.load(Ordering::SeqCst));
/// ```
#[inline]
#[stable]
pub fn fetch_sub(&self, val: uint, order: Ordering) -> uint {
unsafe { atomic_sub(self.v.get(), val, order) }
}
Expand All @@ -747,7 +722,6 @@ impl AtomicUint {
/// assert_eq!(0b101101, foo.fetch_and(0b110011, Ordering::SeqCst));
/// assert_eq!(0b100001, foo.load(Ordering::SeqCst));
#[inline]
#[stable]
pub fn fetch_and(&self, val: uint, order: Ordering) -> uint {
unsafe { atomic_and(self.v.get(), val, order) }
}
Expand All @@ -763,7 +737,6 @@ impl AtomicUint {
/// assert_eq!(0b101101, foo.fetch_or(0b110011, Ordering::SeqCst));
/// assert_eq!(0b111111, foo.load(Ordering::SeqCst));
#[inline]
#[stable]
pub fn fetch_or(&self, val: uint, order: Ordering) -> uint {
unsafe { atomic_or(self.v.get(), val, order) }
}
Expand All @@ -779,7 +752,6 @@ impl AtomicUint {
/// assert_eq!(0b101101, foo.fetch_xor(0b110011, Ordering::SeqCst));
/// assert_eq!(0b011110, foo.load(Ordering::SeqCst));
#[inline]
#[stable]
pub fn fetch_xor(&self, val: uint, order: Ordering) -> uint {
unsafe { atomic_xor(self.v.get(), val, order) }
}
Expand Down
10 changes: 7 additions & 3 deletions src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ Section: Creating a string

/// Errors which can occur when attempting to interpret a byte slice as a `str`.
#[derive(Copy, Eq, PartialEq, Clone)]
#[unstable = "error enumeration recently added and definitions may be refined"]
pub enum Utf8Error {
/// An invalid byte was detected at the byte offset given.
///
Expand All @@ -165,6 +166,7 @@ pub enum Utf8Error {
///
/// Returns `Err` if the slice is not utf-8 with a description as to why the
/// provided slice is not utf-8.
#[stable]
pub fn from_utf8(v: &[u8]) -> Result<&str, Utf8Error> {
try!(run_utf8_validation_iterator(&mut v.iter()));
Ok(unsafe { from_utf8_unchecked(v) })
Expand Down Expand Up @@ -247,6 +249,7 @@ Section: Iterators
///
/// Created with the method `.chars()`.
#[derive(Clone, Copy)]
#[stable]
pub struct Chars<'a> {
iter: slice::Iter<'a, u8>
}
Expand Down Expand Up @@ -356,6 +359,7 @@ impl<'a> DoubleEndedIterator for Chars<'a> {
/// External iterator for a string's characters and their byte offsets.
/// Use with the `std::iter` module.
#[derive(Clone)]
#[stable]
pub struct CharIndices<'a> {
front_offset: uint,
iter: Chars<'a>,
Expand Down Expand Up @@ -848,6 +852,7 @@ impl Searcher {
/// An iterator over the start and end indices of the matches of a
/// substring within a larger string
#[derive(Clone)]
#[unstable = "type may be removed"]
pub struct MatchIndices<'a> {
// constants
haystack: &'a str,
Expand All @@ -858,7 +863,7 @@ pub struct MatchIndices<'a> {
/// An iterator over the substrings of a string separated by a given
/// search string
#[derive(Clone)]
#[unstable = "Type might get removed"]
#[unstable = "type may be removed"]
pub struct SplitStr<'a> {
it: MatchIndices<'a>,
last_end: uint,
Expand Down Expand Up @@ -1056,8 +1061,7 @@ const TAG_CONT_U8: u8 = 0b1000_0000u8;
Section: Trait implementations
*/

#[allow(missing_docs)]
pub mod traits {
mod traits {
use cmp::{Ordering, Ord, PartialEq, PartialOrd, Eq};
use cmp::Ordering::{Less, Equal, Greater};
use iter::IteratorExt;
Expand Down
2 changes: 2 additions & 0 deletions src/libstd/prelude/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@
//! pervasive that it would be obnoxious to import for every use, particularly
//! those that define methods on primitive types.

#![stable]

#[stable]
pub mod v1;
2 changes: 1 addition & 1 deletion src/libstd/sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//! and/or blocking at all, but rather provide the necessary tools to build
//! other types of concurrent primitives.

#![experimental]
#![stable]

pub use alloc::arc::{Arc, Weak};
pub use core::atomic;
Expand Down
3 changes: 3 additions & 0 deletions src/libstd/sync/mpsc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@
//! }
//! ```

#![stable]

// A description of how Rust's channel implementation works
//
// Channels are supposed to be the basic building block for all other
Expand Down Expand Up @@ -565,6 +567,7 @@ impl<T: Send> Sender<T> {
/// drop(rx);
/// assert_eq!(tx.send(1i).err().unwrap().0, 1);
/// ```
#[stable]
pub fn send(&self, t: T) -> Result<(), SendError<T>> {
let (new_inner, ret) = match *unsafe { self.inner() } {
Flavor::Oneshot(ref p) => {
Expand Down
4 changes: 0 additions & 4 deletions src/libstd/sync/once.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ impl Once {
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)]
Expand Down