about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2021-04-10 12:24:08 +0200
committerRalf Jung <post@ralfj.de>2021-04-10 12:24:19 +0200
commit63b682b3ec0a985c38461e05372e0d7eefbea8f7 (patch)
treedacc3f7ac603db9eef88fd77591eb53abb967351
parent481598b26db6144c580dc113f4d78b4151b5a1bc (diff)
downloadrust-63b682b3ec0a985c38461e05372e0d7eefbea8f7.tar.gz
rust-63b682b3ec0a985c38461e05372e0d7eefbea8f7.zip
fix incorrect from_raw_in doctest
-rw-r--r--library/alloc/src/boxed.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs
index 04033905728..ef37fef0455 100644
--- a/library/alloc/src/boxed.rs
+++ b/library/alloc/src/boxed.rs
@@ -793,7 +793,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
     /// use std::alloc::{Allocator, Layout, System};
     ///
     /// unsafe {
-    ///     let ptr = System.allocate(Layout::new::<i32>())?.as_mut_ptr();
+    ///     let ptr = System.allocate(Layout::new::<i32>())?.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.