From 63b682b3ec0a985c38461e05372e0d7eefbea8f7 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 10 Apr 2021 12:24:08 +0200 Subject: [PATCH] fix incorrect from_raw_in doctest --- library/alloc/src/boxed.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs index 04033905728ab..ef37fef045526 100644 --- a/library/alloc/src/boxed.rs +++ b/library/alloc/src/boxed.rs @@ -793,7 +793,7 @@ impl Box { /// use std::alloc::{Allocator, Layout, System}; /// /// unsafe { - /// let ptr = System.allocate(Layout::new::())?.as_mut_ptr(); + /// let ptr = System.allocate(Layout::new::())?.as_mut_ptr() as *mut i32; /// // In general .write is required to avoid attempting to destruct /// // the (uninitialized) previous contents of `ptr`, though for this /// // simple example `*ptr = 5` would have worked as well.