We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4be0675 commit e187574Copy full SHA for e187574
src/libcore/mem/maybe_uninit.rs
@@ -402,6 +402,13 @@ impl<T> MaybeUninit<T> {
402
///
403
/// [inv]: #initialization-invariant
404
405
+ /// On top of that, remember that most types have additional invariants beyond merely
406
+ /// being considered initialized at the type level. For example, a `1`-initialized [`Vec<T>`]
407
+ /// is considered initialized because the only requirement the compiler knows about it
408
+ /// is that the data pointer must be non-null. Creating such a `Vec<T>` does not cause
409
+ /// *immediate* undefined behavior, but will cause undefined behavior with most
410
+ /// safe operations (including dropping it).
411
+ ///
412
/// # Examples
413
414
/// Correct usage of this method:
0 commit comments