We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05ffd44 commit 0e5628dCopy full SHA for 0e5628d
library/alloc/src/boxed.rs
@@ -64,8 +64,9 @@
64
//!
65
//! For zero-sized values, the `Box` pointer has to be non-null and sufficiently aligned. The
66
//! recommended way to build a Box to a ZST if `Box::new` cannot be used is to use
67
-//! [`ptr::NonNull::dangling`]. Even for zero-sized types, the pointee type must be inhabited
68
-//! to ensure that the Box points to a valid value of the given type.
+//! [`ptr::NonNull::dangling`].
+//!
69
+//! On top of these basic layout requirements, a `Box<T>` must point to a valid value of `T`.
70
71
//! So long as `T: Sized`, a `Box<T>` is guaranteed to be represented
72
//! as a single pointer and is also ABI-compatible with C pointers
0 commit comments