]> git.lizzy.rs Git - rust.git/commitdiff
mention that MaybeUninit is a bit like Option
authorRalf Jung <post@ralfj.de>
Tue, 28 May 2019 16:04:37 +0000 (18:04 +0200)
committerRalf Jung <post@ralfj.de>
Tue, 28 May 2019 16:04:37 +0000 (18:04 +0200)
src/libcore/mem.rs

index ce4aee7ebc54f8be0ceed6408e4642a18c4a5918..058c01cdf10077ac008e5cf115c78b4de591236d 100644 (file)
@@ -966,6 +966,9 @@ fn deref_mut(&mut self) -> &mut T {
 ///
 /// The compiler then knows to not make any incorrect assumptions or optimizations on this code.
 ///
+/// You can think of `MaybeUninit<T>` and being a bit like `Option<T>` but without
+/// any of the run-time tracking and without any of the safety checks.
+///
 /// ## out-pointers
 ///
 /// You can use `MaybeUninit<T>` to implement "out-pointers": instead of returning data