From 1f70acbf4c4f345265a7626bd927187d3bfed91f Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 7 Jan 2015 15:48:16 -0800 Subject: Improvements to feature staging This gets rid of the 'experimental' level, removes the non-staged_api case (i.e. stability levels for out-of-tree crates), and lets the staged_api attributes use 'unstable' and 'deprecated' lints. This makes the transition period to the full feature staging design a bit nicer. --- src/liballoc/arc.rs | 16 ++++++++-------- src/liballoc/boxed.rs | 2 +- src/liballoc/lib.rs | 2 +- src/liballoc/rc.rs | 26 +++++++++++++------------- 4 files changed, 23 insertions(+), 23 deletions(-) (limited to 'src/liballoc') diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 48136bc1d96..290dd21d666 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -126,7 +126,7 @@ unsafe impl Sync for Arc { } /// Weak pointers will not keep the data inside of the `Arc` alive, and can be used to break cycles /// between `Arc` pointers. #[unsafe_no_drop_flag] -#[experimental = "Weak pointers may not belong in this module."] +#[unstable = "Weak pointers may not belong in this module."] pub struct Weak { // FIXME #12808: strange name to try to avoid interfering with // field accesses of the contained type via Deref @@ -179,7 +179,7 @@ impl Arc { /// /// let weak_five = five.downgrade(); /// ``` - #[experimental = "Weak pointers may not belong in this module."] + #[unstable = "Weak pointers may not belong in this module."] pub fn downgrade(&self) -> Weak { // See the clone() impl for why this is relaxed self.inner().weak.fetch_add(1, Relaxed); @@ -200,12 +200,12 @@ impl Arc { /// Get the number of weak references to this value. #[inline] -#[experimental] +#[unstable] pub fn weak_count(this: &Arc) -> uint { this.inner().weak.load(SeqCst) - 1 } /// Get the number of strong references to this value. #[inline] -#[experimental] +#[unstable] pub fn strong_count(this: &Arc) -> uint { this.inner().strong.load(SeqCst) } #[stable] @@ -271,7 +271,7 @@ impl Arc { /// let mut_five = five.make_unique(); /// ``` #[inline] - #[experimental] + #[unstable] pub fn make_unique(&mut self) -> &mut T { // Note that we hold a strong reference, which also counts as a weak reference, so we only // clone if there is an additional reference of either kind. @@ -355,7 +355,7 @@ impl Drop for Arc { } } -#[experimental = "Weak pointers may not belong in this module."] +#[unstable = "Weak pointers may not belong in this module."] impl Weak { /// Upgrades a weak reference to a strong reference. /// @@ -393,7 +393,7 @@ impl Weak { } } -#[experimental = "Weak pointers may not belong in this module."] +#[unstable = "Weak pointers may not belong in this module."] impl Clone for Weak { /// Makes a clone of the `Weak`. /// @@ -604,7 +604,7 @@ impl> Hash for Arc { } #[cfg(test)] -#[allow(experimental)] +#[allow(unstable)] mod tests { use std::clone::Clone; use std::sync::mpsc::channel; diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 97b198164eb..458eb3dce57 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -44,7 +44,7 @@ use core::ops::{Deref, DerefMut}; /// } /// ``` #[lang = "exchange_heap"] -#[experimental = "may be renamed; uncertain about custom allocator design"] +#[unstable = "may be renamed; uncertain about custom allocator design"] pub static HEAP: () = (); /// A type that represents a uniquely-owned value. diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 0bb8ba669ec..916015539a0 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -57,7 +57,7 @@ //! default global allocator. It is not compatible with the libc allocator API. #![crate_name = "alloc"] -#![experimental] +#![unstable] #![staged_api] #![crate_type = "rlib"] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 27b3f03002f..f42c6dbdc15 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -221,7 +221,7 @@ impl Rc { /// /// let weak_five = five.downgrade(); /// ``` - #[experimental = "Weak pointers may not belong in this module"] + #[unstable = "Weak pointers may not belong in this module"] pub fn downgrade(&self) -> Weak { self.inc_weak(); Weak { @@ -234,12 +234,12 @@ impl Rc { /// Get the number of weak references to this value. #[inline] -#[experimental] +#[unstable] pub fn weak_count(this: &Rc) -> uint { this.weak() - 1 } /// Get the number of strong references to this value. #[inline] -#[experimental] +#[unstable] pub fn strong_count(this: &Rc) -> uint { this.strong() } /// Returns true if there are no other `Rc` or `Weak` values that share the same inner value. @@ -255,7 +255,7 @@ pub fn strong_count(this: &Rc) -> uint { this.strong() } /// rc::is_unique(&five); /// ``` #[inline] -#[experimental] +#[unstable] pub fn is_unique(rc: &Rc) -> bool { weak_count(rc) == 0 && strong_count(rc) == 1 } @@ -277,7 +277,7 @@ pub fn is_unique(rc: &Rc) -> bool { /// assert_eq!(rc::try_unwrap(x), Err(Rc::new(4u))); /// ``` #[inline] -#[experimental] +#[unstable] pub fn try_unwrap(rc: Rc) -> Result> { if is_unique(&rc) { unsafe { @@ -311,7 +311,7 @@ pub fn try_unwrap(rc: Rc) -> Result> { /// assert!(rc::get_mut(&mut x).is_none()); /// ``` #[inline] -#[experimental] +#[unstable] pub fn get_mut<'a, T>(rc: &'a mut Rc) -> Option<&'a mut T> { if is_unique(rc) { let inner = unsafe { &mut **rc._ptr }; @@ -337,7 +337,7 @@ impl Rc { /// let mut_five = five.make_unique(); /// ``` #[inline] - #[experimental] + #[unstable] pub fn make_unique(&mut self) -> &mut T { if !is_unique(self) { *self = Rc::new((**self).clone()) @@ -615,7 +615,7 @@ impl> Hash for Rc { } } -#[experimental = "Show is experimental."] +#[unstable = "Show is experimental."] impl fmt::Show for Rc { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Rc({:?})", **self) @@ -635,7 +635,7 @@ impl fmt::String for Rc { /// /// See the [module level documentation](../index.html) for more. #[unsafe_no_drop_flag] -#[experimental = "Weak pointers may not belong in this module."] +#[unstable = "Weak pointers may not belong in this module."] pub struct Weak { // FIXME #12808: strange names to try to avoid interfering with // field accesses of the contained type via Deref @@ -644,7 +644,7 @@ pub struct Weak { _noshare: marker::NoSync } -#[experimental = "Weak pointers may not belong in this module."] +#[unstable = "Weak pointers may not belong in this module."] impl Weak { /// Upgrades a weak reference to a strong reference. /// @@ -717,7 +717,7 @@ impl Drop for Weak { } } -#[experimental = "Weak pointers may not belong in this module."] +#[unstable = "Weak pointers may not belong in this module."] impl Clone for Weak { /// Makes a clone of the `Weak`. /// @@ -739,7 +739,7 @@ impl Clone for Weak { } } -#[experimental = "Show is experimental."] +#[unstable = "Show is experimental."] impl fmt::Show for Weak { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "(Weak)") @@ -780,7 +780,7 @@ impl RcBoxPtr for Weak { } #[cfg(test)] -#[allow(experimental)] +#[allow(unstable)] mod tests { use super::{Rc, Weak, weak_count, strong_count}; use std::cell::RefCell; -- cgit 1.4.1-3-g733a5