mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
fix incorrect from_raw_in doctest
This commit is contained in:
parent
481598b26d
commit
63b682b3ec
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user