Skip to content

Commit

Permalink
fix incorrect from_raw_in doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Apr 10, 2021
1 parent 481598b commit 63b682b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/alloc/src/boxed.rs
Expand Up @@ -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.
Expand Down

0 comments on commit 63b682b

Please sign in to comment.