diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs index 25c63b425ce59..cda6242519b71 100644 --- a/library/alloc/src/boxed.rs +++ b/library/alloc/src/boxed.rs @@ -1044,7 +1044,12 @@ impl Box { /// dealloc(p as *mut u8, Layout::new::()); /// } /// ``` - /// + /// Note: This is equivalent to the following: + /// ``` + /// let x = Box::new(String::from("Hello")); + /// let p = Box::into_raw(x); + /// drop(Box::from_raw(ptr)); + /// ``` /// [memory layout]: self#memory-layout #[stable(feature = "box_raw", since = "1.4.0")] #[inline]