about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-02-24 20:34:24 +0100
committerRalf Jung <post@ralfj.de>2019-02-24 20:34:24 +0100
commit6d32e5ae1a7a6cf7bc28f41d4c99ed81ac6113aa (patch)
tree0c8874988947e0884d1dc738dc57bc124a04c373
parentbe8d728f3cb1cb79a630c6e6aba6df923dd3e999 (diff)
downloadrust-6d32e5ae1a7a6cf7bc28f41d4c99ed81ac6113aa.tar.gz
rust-6d32e5ae1a7a6cf7bc28f41d4c99ed81ac6113aa.zip
prefer into_initialized over read_initialited
-rw-r--r--src/libcore/mem.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs
index 967a36f6f1c..4b5056c5adf 100644
--- a/src/libcore/mem.rs
+++ b/src/libcore/mem.rs
@@ -1321,6 +1321,9 @@ impl<T> MaybeUninit<T> {
     /// Reads the value from the `MaybeUninit<T>` container. The resulting `T` is subject
     /// to the usual drop handling.
     ///
+    /// Whenever possible, it is preferrable to use [`into_initialized`] instead, which
+    /// prevents duplicating the content of the `MaybeUninit<T>`.
+    ///
     /// # Safety
     ///
     /// It is up to the caller to guarantee that the `MaybeUninit<T>` really is in an initialized