@@ -531,9 +531,9 @@ pub unsafe fn zeroed<T>() -> T {
531
531
/// includes a `panic` occurring and unwinding the stack suddenly.
532
532
///
533
533
/// 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
537
537
/// undefined behaviour.
538
538
///
539
539
/// # Examples
@@ -589,7 +589,7 @@ pub unsafe fn zeroed<T>() -> T {
589
589
/// println!("{:?}", &data[0]);
590
590
/// ```
591
591
///
592
- /// This example shows how to handle partially allocated arrays, which could
592
+ /// This example shows how to handle partially initialized arrays, which could
593
593
/// be found in low-level datastructures.
594
594
///
595
595
/// ```
@@ -618,10 +618,6 @@ pub unsafe fn zeroed<T>() -> T {
618
618
/// mem::forget(data);
619
619
/// ```
620
620
///
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
- ///
625
621
/// [`Vec`]: ../../std/vec/struct.Vec.html
626
622
/// [`vec!`]: ../../std/macro.vec.html
627
623
/// [`Clone`]: ../../std/clone/trait.Clone.html
0 commit comments