]> git.lizzy.rs Git - rust.git/commitdiff
Updates based on comment
authorWilliam Brown <william@blackhats.net.au>
Wed, 19 Dec 2018 02:40:57 +0000 (12:40 +1000)
committerWilliam Brown <william@blackhats.net.au>
Wed, 19 Dec 2018 02:40:57 +0000 (12:40 +1000)
src/libcore/mem.rs

index 7e4e83999c1a3d2c45ad9d1eae536e6efdbb3d02..7492cf4c5ed327c9b4b549146924abe7372d26c6 100644 (file)
@@ -531,9 +531,9 @@ pub unsafe fn zeroed<T>() -> T {
 /// includes a `panic` occurring and unwinding the stack suddenly.
 ///
 /// If you partially initialize an array, you may need to use
-/// [`ptr::drop_in_place`][drop_in_place] to remove the set you have created
-/// followed by [`mem::forget`][mem_forget] to prevent drop running on the
-/// array. If a partially allocated array is dropped this may lead to
+/// [`ptr::drop_in_place`][drop_in_place] to remove the elements you have fully
+/// initialized followed by [`mem::forget`][mem_forget] to prevent drop running
+/// on the array. If a partially allocated array is dropped this will lead to
 /// undefined behaviour.
 ///
 /// # Examples
@@ -589,7 +589,7 @@ pub unsafe fn zeroed<T>() -> T {
 /// println!("{:?}", &data[0]);
 /// ```
 ///
-/// This example shows how to handle partially allocated arrays, which could
+/// This example shows how to handle partially initialized arrays, which could
 /// be found in low-level datastructures.
 ///
 /// ```
@@ -618,10 +618,6 @@ pub unsafe fn zeroed<T>() -> T {
 /// mem::forget(data);
 /// ```
 ///
-/// An alternate strategy is to use [`mem::zeroed`][mem_zeroed] with ptr
-/// comparison. This is a very error prone strategy and may only be relevant
-/// for FFI.
-///
 /// [`Vec`]: ../../std/vec/struct.Vec.html
 /// [`vec!`]: ../../std/macro.vec.html
 /// [`Clone`]: ../../std/clone/trait.Clone.html