mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
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
|
||||
//! 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
|
||||
//! to ensure that the Box points to a valid value of the given type.
|
||||
//! [`ptr::NonNull::dangling`].
|
||||
//!
|
||||
//! 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
|
||||
//! as a single pointer and is also ABI-compatible with C pointers
|
||||
|
Loading…
Reference in New Issue
Block a user