assume_init: warn about valid != safe
This commit is contained in:
parent
4be0675589
commit
e1875742d0
1 changed files with 7 additions and 0 deletions
|
|
@ -402,6 +402,13 @@ impl<T> MaybeUninit<T> {
|
|||
///
|
||||
/// [inv]: #initialization-invariant
|
||||
///
|
||||
/// On top of that, remember that most types have additional invariants beyond merely
|
||||
/// being considered initialized at the type level. For example, a `1`-initialized [`Vec<T>`]
|
||||
/// is considered initialized because the only requirement the compiler knows about it
|
||||
/// is that the data pointer must be non-null. Creating such a `Vec<T>` does not cause
|
||||
/// *immediate* undefined behavior, but will cause undefined behavior with most
|
||||
/// safe operations (including dropping it).
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Correct usage of this method:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue