about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/arc.rs8
-rw-r--r--src/liballoc/boxed.rs3
-rw-r--r--src/liballoc/lib.rs1
-rw-r--r--src/liballoc/rc.rs12
4 files changed, 24 insertions, 0 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs
index 8528be2860c..97d3f78f67c 100644
--- a/src/liballoc/arc.rs
+++ b/src/liballoc/arc.rs
@@ -95,6 +95,7 @@ use heap::deallocate;
 /// task.
 ///
 /// ```
+/// # #![feature(alloc, core)]
 /// use std::sync::Arc;
 /// use std::thread;
 ///
@@ -185,6 +186,7 @@ impl<T> Arc<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::sync::Arc;
     ///
     /// let five = Arc::new(5);
@@ -246,6 +248,7 @@ impl<T> Clone for Arc<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::sync::Arc;
     ///
     /// let five = Arc::new(5);
@@ -289,6 +292,7 @@ impl<T: Send + Sync + Clone> Arc<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::sync::Arc;
     ///
     /// let mut five = Arc::new(5);
@@ -324,6 +328,7 @@ impl<T: Sync + Send> Drop for Arc<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::sync::Arc;
     ///
     /// {
@@ -387,6 +392,7 @@ impl<T: Sync + Send> Weak<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::sync::Arc;
     ///
     /// let five = Arc::new(5);
@@ -424,6 +430,7 @@ impl<T: Sync + Send> Clone for Weak<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::sync::Arc;
     ///
     /// let weak_five = Arc::new(5).downgrade();
@@ -448,6 +455,7 @@ impl<T: Sync + Send> Drop for Weak<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::sync::Arc;
     ///
     /// {
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs
index 6bdfe2b1551..8b18fbf554a 100644
--- a/src/liballoc/boxed.rs
+++ b/src/liballoc/boxed.rs
@@ -65,6 +65,7 @@ use core::raw::TraitObject;
 /// The following two examples are equivalent:
 ///
 /// ```
+/// # #![feature(alloc)]
 /// #![feature(box_syntax)]
 /// use std::boxed::HEAP;
 ///
@@ -135,6 +136,7 @@ impl<T : ?Sized> Box<T> {
 ///
 /// # Examples
 /// ```
+/// # #![feature(alloc)]
 /// use std::boxed;
 ///
 /// let seventeen = Box::new(17u32);
@@ -178,6 +180,7 @@ impl<T: Clone> Clone for Box<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc, core)]
     /// let x = Box::new(5);
     /// let mut y = Box::new(10);
     ///
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index 34c0686fe37..541de2d37fb 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -66,6 +66,7 @@
 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
        html_favicon_url = "http://www.rust-lang.org/favicon.ico",
        html_root_url = "http://doc.rust-lang.org/nightly/")]
+#![doc(test(no_crate_inject))]
 
 #![feature(no_std)]
 #![no_std]
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs
index 855235e89c8..e4b09bba529 100644
--- a/src/liballoc/rc.rs
+++ b/src/liballoc/rc.rs
@@ -32,6 +32,7 @@
 //! and have the `Owner` remain allocated as long as any `Gadget` points at it.
 //!
 //! ```rust
+//! # #![feature(alloc, collections)]
 //! use std::rc::Rc;
 //!
 //! struct Owner {
@@ -88,6 +89,7 @@
 //! Read the `Cell` documentation for more details on interior mutability.
 //!
 //! ```rust
+//! # #![feature(alloc)]
 //! use std::rc::Rc;
 //! use std::rc::Weak;
 //! use std::cell::RefCell;
@@ -218,6 +220,7 @@ impl<T> Rc<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::rc::Rc;
     ///
     /// let five = Rc::new(5);
@@ -247,6 +250,7 @@ pub fn strong_count<T>(this: &Rc<T>) -> usize { this.strong() }
 /// # Examples
 ///
 /// ```
+/// # #![feature(alloc)]
 /// use std::rc;
 /// use std::rc::Rc;
 ///
@@ -267,6 +271,7 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool {
 /// # Examples
 ///
 /// ```
+/// # #![feature(alloc)]
 /// use std::rc::{self, Rc};
 ///
 /// let x = Rc::new(3);
@@ -301,6 +306,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(alloc)]
 /// use std::rc::{self, Rc};
 ///
 /// let mut x = Rc::new(3);
@@ -330,6 +336,7 @@ impl<T: Clone> Rc<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::rc::Rc;
     ///
     /// let mut five = Rc::new(5);
@@ -372,6 +379,7 @@ impl<T> Drop for Rc<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::rc::Rc;
     ///
     /// {
@@ -420,6 +428,7 @@ impl<T> Clone for Rc<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::rc::Rc;
     ///
     /// let five = Rc::new(5);
@@ -648,6 +657,7 @@ impl<T> Weak<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::rc::Rc;
     ///
     /// let five = Rc::new(5);
@@ -676,6 +686,7 @@ impl<T> Drop for Weak<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::rc::Rc;
     ///
     /// {
@@ -721,6 +732,7 @@ impl<T> Clone for Weak<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::rc::Rc;
     ///
     /// let weak_five = Rc::new(5).downgrade();