tweak wording regarding Box validity
This commit is contained in:
parent
05ffd446a9
commit
0e5628d7de
@ -64,8 +64,9 @@
|
|||||||
//!
|
//!
|
||||||
//! For zero-sized values, the `Box` pointer has to be non-null and sufficiently aligned. The
|
//! For zero-sized values, the `Box` pointer has to be non-null and sufficiently aligned. The
|
||||||
//! recommended way to build a Box to a ZST if `Box::new` cannot be used is to use
|
//! recommended way to build a Box to a ZST if `Box::new` cannot be used is to use
|
||||||
//! [`ptr::NonNull::dangling`]. Even for zero-sized types, the pointee type must be inhabited
|
//! [`ptr::NonNull::dangling`].
|
||||||
//! to ensure that the Box points to a valid value of the given type.
|
//!
|
||||||
|
//! On top of these basic layout requirements, a `Box<T>` must point to a valid value of `T`.
|
||||||
//!
|
//!
|
||||||
//! So long as `T: Sized`, a `Box<T>` is guaranteed to be represented
|
//! So long as `T: Sized`, a `Box<T>` is guaranteed to be represented
|
||||||
//! as a single pointer and is also ABI-compatible with C pointers
|
//! as a single pointer and is also ABI-compatible with C pointers
|
||||||
|
Loading…
x
Reference in New Issue
Block a user