Skip to content

Commit 0829d0c

Browse files
committed
Updates based on comment
1 parent 00bd306 commit 0829d0c

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/libcore/mem.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,9 @@ pub unsafe fn zeroed<T>() -> T {
531531
/// includes a `panic` occurring and unwinding the stack suddenly.
532532
///
533533
/// If you partially initialize an array, you may need to use
534-
/// [`ptr::drop_in_place`][drop_in_place] to remove the set you have created
535-
/// followed by [`mem::forget`][mem_forget] to prevent drop running on the
536-
/// array. If a partially allocated array is dropped this may lead to
534+
/// [`ptr::drop_in_place`][drop_in_place] to remove the elements you have fully
535+
/// initialized followed by [`mem::forget`][mem_forget] to prevent drop running
536+
/// on the array. If a partially allocated array is dropped this will lead to
537537
/// undefined behaviour.
538538
///
539539
/// # Examples
@@ -589,7 +589,7 @@ pub unsafe fn zeroed<T>() -> T {
589589
/// println!("{:?}", &data[0]);
590590
/// ```
591591
///
592-
/// This example shows how to handle partially allocated arrays, which could
592+
/// This example shows how to handle partially initialized arrays, which could
593593
/// be found in low-level datastructures.
594594
///
595595
/// ```
@@ -618,10 +618,6 @@ pub unsafe fn zeroed<T>() -> T {
618618
/// mem::forget(data);
619619
/// ```
620620
///
621-
/// An alternate strategy is to use [`mem::zeroed`][mem_zeroed] with ptr
622-
/// comparison. This is a very error prone strategy and may only be relevant
623-
/// for FFI.
624-
///
625621
/// [`Vec`]: ../../std/vec/struct.Vec.html
626622
/// [`vec!`]: ../../std/macro.vec.html
627623
/// [`Clone`]: ../../std/clone/trait.Clone.html

0 commit comments

Comments
 (0)