Skip to content

Commit 22298b8

Browse files
committed
Add unique feature in Box::from_unique docs
1 parent 5af88ee commit 22298b8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/liballoc/boxed.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,13 @@ impl<T: ?Sized> Box<T> {
288288
/// # Examples
289289
///
290290
/// ```
291-
/// let x = Box::new(5);
292-
/// let ptr = Box::into_unique(x);
293-
/// let x = unsafe { Box::from_unique(ptr) };
291+
/// #![feature(unique)]
292+
///
293+
/// fn main() {
294+
/// let x = Box::new(5);
295+
/// let ptr = Box::into_unique(x);
296+
/// let x = unsafe { Box::from_unique(ptr) };
297+
/// }
294298
/// ```
295299
#[unstable(feature = "unique", reason = "needs an RFC to flesh out design",
296300
issue = "27730")]

0 commit comments

Comments
 (0)