diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-06-10 13:33:52 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-06-17 09:07:16 -0700 |
| commit | ce1a965cf54ce65fc43b535c27029ce183214063 (patch) | |
| tree | 6fc6809fa8152fd85d52707d4591fd329aff5880 /src/liballoc | |
| parent | 6895311e859e1859f9b3f0adc9f1fbb4d2891534 (diff) | |
| download | rust-ce1a965cf54ce65fc43b535c27029ce183214063.tar.gz rust-ce1a965cf54ce65fc43b535c27029ce183214063.zip | |
Fallout in tests and docs from feature renamings
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 20 | ||||
| -rw-r--r-- | src/liballoc/boxed.rs | 8 | ||||
| -rw-r--r-- | src/liballoc/lib.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 33 |
4 files changed, 30 insertions, 33 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index e0d459d877f..c1ad367c234 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -191,7 +191,7 @@ impl<T: ?Sized> Arc<T> { /// # Examples /// /// ``` - /// # #![feature(alloc)] + /// # #![feature(arc_weak)] /// use std::sync::Arc; /// /// let five = Arc::new(5); @@ -236,12 +236,12 @@ impl<T: ?Sized> Arc<T> { /// Get the number of weak references to this value. #[inline] -#[unstable(feature = "arc_extras")] +#[unstable(feature = "arc_counts")] pub fn weak_count<T: ?Sized>(this: &Arc<T>) -> usize { this.inner().weak.load(SeqCst) - 1 } /// Get the number of strong references to this value. #[inline] -#[unstable(feature = "arc_extras")] +#[unstable(feature = "arc_counts")] pub fn strong_count<T: ?Sized>(this: &Arc<T>) -> usize { this.inner().strong.load(SeqCst) } @@ -255,7 +255,7 @@ pub fn strong_count<T: ?Sized>(this: &Arc<T>) -> usize { this.inner().strong.loa /// # Examples /// /// ``` -/// # #![feature(alloc)] +/// # #![feature(arc_unique, alloc)] /// extern crate alloc; /// # fn main() { /// use alloc::arc::{Arc, get_mut}; @@ -271,7 +271,7 @@ pub fn strong_count<T: ?Sized>(this: &Arc<T>) -> usize { this.inner().strong.loa /// # } /// ``` #[inline] -#[unstable(feature = "arc_extras")] +#[unstable(feature = "arc_unique")] pub unsafe fn get_mut<T: ?Sized>(this: &mut Arc<T>) -> Option<&mut T> { // FIXME(#24880) potential race with upgraded weak pointers here if strong_count(this) == 1 && weak_count(this) == 0 { @@ -342,7 +342,7 @@ impl<T: Clone> Arc<T> { /// # Examples /// /// ``` - /// # #![feature(alloc)] + /// # #![feature(arc_unique)] /// use std::sync::Arc; /// /// # unsafe { @@ -352,7 +352,7 @@ impl<T: Clone> Arc<T> { /// # } /// ``` #[inline] - #[unstable(feature = "arc_extras")] + #[unstable(feature = "arc_unique")] pub unsafe fn make_unique(&mut self) -> &mut T { // FIXME(#24880) potential race with upgraded weak pointers here // @@ -451,7 +451,7 @@ impl<T: ?Sized> Weak<T> { /// # Examples /// /// ``` - /// # #![feature(alloc)] + /// # #![feature(arc_weak)] /// use std::sync::Arc; /// /// let five = Arc::new(5); @@ -489,7 +489,7 @@ impl<T: ?Sized> Clone for Weak<T> { /// # Examples /// /// ``` - /// # #![feature(alloc)] + /// # #![feature(arc_weak)] /// use std::sync::Arc; /// /// let weak_five = Arc::new(5).downgrade(); @@ -513,7 +513,7 @@ impl<T: ?Sized> Drop for Weak<T> { /// # Examples /// /// ``` - /// # #![feature(alloc)] + /// # #![feature(arc_weak)] /// use std::sync::Arc; /// /// { diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index ffc4186dee8..b59a5685f0d 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -71,7 +71,7 @@ use core::raw::{TraitObject}; /// The following two examples are equivalent: /// /// ``` -/// # #![feature(alloc)] +/// # #![feature(box_heap)] /// #![feature(box_syntax)] /// use std::boxed::HEAP; /// @@ -139,7 +139,7 @@ impl<T : ?Sized> Box<T> { /// /// # Examples /// ``` -/// # #![feature(alloc)] +/// # #![feature(box_raw)] /// use std::boxed; /// /// let seventeen = Box::new(17u32); @@ -183,7 +183,7 @@ impl<T: Clone> Clone for Box<T> { /// # Examples /// /// ``` - /// # #![feature(alloc, core)] + /// # #![feature(box_raw)] /// let x = Box::new(5); /// let mut y = Box::new(10); /// @@ -336,7 +336,7 @@ impl<I: ExactSizeIterator + ?Sized> ExactSizeIterator for Box<I> {} /// -> i32>`. /// /// ``` -/// #![feature(core)] +/// #![feature(fnbox)] /// /// use std::boxed::FnBox; /// use std::collections::HashMap; diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index e297d4cbf77..7dcf7a76da0 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -89,7 +89,7 @@ #![feature(unsafe_no_drop_flag, filling_drop)] #![feature(unsize)] -#![cfg_attr(test, feature(test, alloc, rustc_private))] +#![cfg_attr(test, feature(test, alloc, rustc_private, box_raw))] #![cfg_attr(all(not(feature = "external_funcs"), not(feature = "external_crate")), feature(libc))] diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 04dde7a07f9..802591a6171 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -32,7 +32,6 @@ //! and have the `Owner` remain allocated as long as any `Gadget` points at it. //! //! ```rust -//! # #![feature(alloc)] //! use std::rc::Rc; //! //! struct Owner { @@ -92,7 +91,7 @@ //! documentation for more details on interior mutability. //! //! ```rust -//! # #![feature(alloc)] +//! # #![feature(rc_weak)] //! use std::rc::Rc; //! use std::rc::Weak; //! use std::cell::RefCell; @@ -229,7 +228,7 @@ impl<T: ?Sized> Rc<T> { /// # Examples /// /// ``` - /// # #![feature(alloc)] + /// # #![feature(rc_weak)] /// use std::rc::Rc; /// /// let five = Rc::new(5); @@ -246,12 +245,12 @@ impl<T: ?Sized> Rc<T> { /// Get the number of weak references to this value. #[inline] -#[unstable(feature = "rc_extras")] +#[unstable(feature = "rc_counts")] pub fn weak_count<T: ?Sized>(this: &Rc<T>) -> usize { this.weak() - 1 } /// Get the number of strong references to this value. #[inline] -#[unstable(feature = "rc_extras")] +#[unstable(feature = "rc_counts")] pub fn strong_count<T: ?Sized>(this: &Rc<T>) -> usize { this.strong() } /// Returns true if there are no other `Rc` or `Weak<T>` values that share the @@ -260,7 +259,7 @@ pub fn strong_count<T: ?Sized>(this: &Rc<T>) -> usize { this.strong() } /// # Examples /// /// ``` -/// # #![feature(alloc)] +/// # #![feature(rc_unique)] /// use std::rc; /// use std::rc::Rc; /// @@ -269,7 +268,7 @@ pub fn strong_count<T: ?Sized>(this: &Rc<T>) -> usize { this.strong() } /// rc::is_unique(&five); /// ``` #[inline] -#[unstable(feature = "rc_extras")] +#[unstable(feature = "rc_unique")] pub fn is_unique<T>(rc: &Rc<T>) -> bool { weak_count(rc) == 0 && strong_count(rc) == 1 } @@ -281,7 +280,7 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool { /// # Examples /// /// ``` -/// # #![feature(alloc)] +/// # #![feature(rc_unique)] /// use std::rc::{self, Rc}; /// /// let x = Rc::new(3); @@ -292,7 +291,7 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool { /// assert_eq!(rc::try_unwrap(x), Err(Rc::new(4))); /// ``` #[inline] -#[unstable(feature = "rc_extras")] +#[unstable(feature = "rc_unique")] pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> { if is_unique(&rc) { unsafe { @@ -316,7 +315,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> { /// # Examples /// /// ``` -/// # #![feature(alloc)] +/// # #![feature(rc_unique)] /// use std::rc::{self, Rc}; /// /// let mut x = Rc::new(3); @@ -327,7 +326,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> { /// assert!(rc::get_mut(&mut x).is_none()); /// ``` #[inline] -#[unstable(feature = "rc_extras")] +#[unstable(feature = "rc_unique")] pub fn get_mut<T>(rc: &mut Rc<T>) -> Option<&mut T> { if is_unique(rc) { let inner = unsafe { &mut **rc._ptr }; @@ -346,7 +345,7 @@ impl<T: Clone> Rc<T> { /// # Examples /// /// ``` - /// # #![feature(alloc)] + /// # #![feature(rc_unique)] /// use std::rc::Rc; /// /// let mut five = Rc::new(5); @@ -354,7 +353,7 @@ impl<T: Clone> Rc<T> { /// let mut_five = five.make_unique(); /// ``` #[inline] - #[unstable(feature = "rc_extras")] + #[unstable(feature = "rc_unique")] pub fn make_unique(&mut self) -> &mut T { if !is_unique(self) { *self = Rc::new((**self).clone()) @@ -390,7 +389,6 @@ impl<T: ?Sized> Drop for Rc<T> { /// # Examples /// /// ``` - /// # #![feature(alloc)] /// use std::rc::Rc; /// /// { @@ -443,7 +441,6 @@ impl<T: ?Sized> Clone for Rc<T> { /// # Examples /// /// ``` - /// # #![feature(alloc)] /// use std::rc::Rc; /// /// let five = Rc::new(5); @@ -677,7 +674,7 @@ impl<T: ?Sized> Weak<T> { /// # Examples /// /// ``` - /// # #![feature(alloc)] + /// # #![feature(rc_weak)] /// use std::rc::Rc; /// /// let five = Rc::new(5); @@ -705,7 +702,7 @@ impl<T: ?Sized> Drop for Weak<T> { /// # Examples /// /// ``` - /// # #![feature(alloc)] + /// # #![feature(rc_weak)] /// use std::rc::Rc; /// /// { @@ -752,7 +749,7 @@ impl<T: ?Sized> Clone for Weak<T> { /// # Examples /// /// ``` - /// # #![feature(alloc)] + /// # #![feature(rc_weak)] /// use std::rc::Rc; /// /// let weak_five = Rc::new(5).downgrade(); |
