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/boxed.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs
index 2c14dfb1dd0..0d19b74ebae 100644
--- a/src/liballoc/boxed.rs
+++ b/src/liballoc/boxed.rs
@@ -288,9 +288,13 @@ impl<T: ?Sized> Box<T> {
     /// # Examples
     ///
     /// ```
-    /// let x = Box::new(5);
-    /// let ptr = Box::into_unique(x);
-    /// let x = unsafe { Box::from_unique(ptr) };
+    /// #![feature(unique)]
+    ///
+    /// fn main() {
+    ///     let x = Box::new(5);
+    ///     let ptr = Box::into_unique(x);
+    ///     let x = unsafe { Box::from_unique(ptr) };
+    /// }
     /// ```
     #[unstable(feature = "unique", reason = "needs an RFC to flesh out design",
                issue = "27730")]