diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2015-07-27 10:50:19 -0400 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2015-07-27 12:28:13 -0400 |
| commit | ba5fcb726fb88cc8393f48c9f46ba03fcadf0511 (patch) | |
| tree | abbbe227f14e6553d47201ad533e8d5b91fa4672 /src/liballoc | |
| parent | d019a49ac86322703e1daad0ebca393856185b32 (diff) | |
| download | rust-ba5fcb726fb88cc8393f48c9f46ba03fcadf0511.tar.gz rust-ba5fcb726fb88cc8393f48c9f46ba03fcadf0511.zip | |
Show appropriate feature flags in docs
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 18 | ||||
| -rw-r--r-- | src/liballoc/boxed.rs | 12 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 36 |
3 files changed, 44 insertions, 22 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 2a47fd29bd6..05308b3e9d8 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -200,7 +200,8 @@ impl<T: ?Sized> Arc<T> { /// # Examples /// /// ``` - /// # #![feature(arc_weak)] + /// #![feature(arc_weak)] + /// /// use std::sync::Arc; /// /// let five = Arc::new(5); @@ -337,7 +338,8 @@ impl<T: Clone> Arc<T> { /// # Examples /// /// ``` - /// # #![feature(arc_unique)] + /// #![feature(arc_unique)] + /// /// use std::sync::Arc; /// /// let mut five = Arc::new(5); @@ -408,7 +410,8 @@ impl<T: ?Sized> Arc<T> { /// # Examples /// /// ``` - /// # #![feature(arc_unique, alloc)] + /// #![feature(arc_unique, alloc)] + /// /// extern crate alloc; /// # fn main() { /// use alloc::arc::Arc; @@ -555,7 +558,8 @@ impl<T: ?Sized> Weak<T> { /// # Examples /// /// ``` - /// # #![feature(arc_weak)] + /// #![feature(arc_weak)] + /// /// use std::sync::Arc; /// /// let five = Arc::new(5); @@ -599,7 +603,8 @@ impl<T: ?Sized> Clone for Weak<T> { /// # Examples /// /// ``` - /// # #![feature(arc_weak)] + /// #![feature(arc_weak)] + /// /// use std::sync::Arc; /// /// let weak_five = Arc::new(5).downgrade(); @@ -626,7 +631,8 @@ impl<T: ?Sized> Drop for Weak<T> { /// # Examples /// /// ``` - /// # #![feature(arc_weak)] + /// #![feature(arc_weak)] + /// /// use std::sync::Arc; /// /// { diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index acf22094233..e6743990e35 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -74,7 +74,8 @@ use core::raw::{TraitObject}; /// The following two examples are equivalent: /// /// ``` -/// # #![feature(box_heap)] +/// #![feature(box_heap)] +/// /// #![feature(box_syntax, placement_in_syntax)] /// use std::boxed::HEAP; /// @@ -237,7 +238,8 @@ impl<T : ?Sized> Box<T> { /// /// # Examples /// ``` - /// # #![feature(box_raw)] + /// #![feature(box_raw)] + /// /// let seventeen = Box::new(17u32); /// let raw = Box::into_raw(seventeen); /// let boxed_again = unsafe { Box::from_raw(raw) }; @@ -260,7 +262,8 @@ impl<T : ?Sized> Box<T> { /// /// # Examples /// ``` -/// # #![feature(box_raw)] +/// #![feature(box_raw)] +/// /// use std::boxed; /// /// let seventeen = Box::new(17u32); @@ -303,7 +306,8 @@ impl<T: Clone> Clone for Box<T> { /// # Examples /// /// ``` - /// # #![feature(box_raw)] + /// #![feature(box_raw)] + /// /// let x = Box::new(5); /// let mut y = Box::new(10); /// diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index d461eeea0b7..b4f993205d1 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -91,7 +91,8 @@ //! documentation for more details on interior mutability. //! //! ```rust -//! # #![feature(rc_weak)] +//! #![feature(rc_weak)] +//! //! use std::rc::Rc; //! use std::rc::Weak; //! use std::cell::RefCell; @@ -227,7 +228,8 @@ impl<T> Rc<T> { /// # Examples /// /// ``` - /// # #![feature(rc_unique)] + /// #![feature(rc_unique)] + /// /// use std::rc::Rc; /// /// let x = Rc::new(3); @@ -262,7 +264,8 @@ impl<T: ?Sized> Rc<T> { /// # Examples /// /// ``` - /// # #![feature(rc_weak)] + /// #![feature(rc_weak)] + /// /// use std::rc::Rc; /// /// let five = Rc::new(5); @@ -292,7 +295,8 @@ impl<T: ?Sized> Rc<T> { /// # Examples /// /// ``` - /// # #![feature(rc_unique)] + /// #![feature(rc_unique)] + /// /// use std::rc::Rc; /// /// let five = Rc::new(5); @@ -313,7 +317,8 @@ impl<T: ?Sized> Rc<T> { /// # Examples /// /// ``` - /// # #![feature(rc_unique)] + /// #![feature(rc_unique)] + /// /// use std::rc::Rc; /// /// let mut x = Rc::new(3); @@ -353,7 +358,8 @@ pub fn strong_count<T: ?Sized>(this: &Rc<T>) -> usize { Rc::strong_count(this) } /// # Examples /// /// ``` -/// # #![feature(rc_unique)] +/// #![feature(rc_unique)] +/// /// use std::rc; /// use std::rc::Rc; /// @@ -373,7 +379,8 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool { Rc::is_unique(rc) } /// # Examples /// /// ``` -/// # #![feature(rc_unique)] +/// #![feature(rc_unique)] +/// /// use std::rc::{self, Rc}; /// /// let x = Rc::new(3); @@ -395,7 +402,8 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> { Rc::try_unwrap(rc) } /// # Examples /// /// ``` -/// # #![feature(rc_unique)] +/// #![feature(rc_unique)] +/// /// use std::rc::{self, Rc}; /// /// let mut x = Rc::new(3); @@ -419,7 +427,8 @@ impl<T: Clone> Rc<T> { /// # Examples /// /// ``` - /// # #![feature(rc_unique)] + /// #![feature(rc_unique)] + /// /// use std::rc::Rc; /// /// let mut five = Rc::new(5); @@ -750,7 +759,8 @@ impl<T: ?Sized> Weak<T> { /// # Examples /// /// ``` - /// # #![feature(rc_weak)] + /// #![feature(rc_weak)] + /// /// use std::rc::Rc; /// /// let five = Rc::new(5); @@ -778,7 +788,8 @@ impl<T: ?Sized> Drop for Weak<T> { /// # Examples /// /// ``` - /// # #![feature(rc_weak)] + /// #![feature(rc_weak)] + /// /// use std::rc::Rc; /// /// { @@ -825,7 +836,8 @@ impl<T: ?Sized> Clone for Weak<T> { /// # Examples /// /// ``` - /// # #![feature(rc_weak)] + /// #![feature(rc_weak)] + /// /// use std::rc::Rc; /// /// let weak_five = Rc::new(5).downgrade(); |
