Skip to content

Commit 0e5628d

Browse files
committed
tweak wording regarding Box validity
1 parent 05ffd44 commit 0e5628d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

library/alloc/src/boxed.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@
6464
//!
6565
//! For zero-sized values, the `Box` pointer has to be non-null and sufficiently aligned. The
6666
//! 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.
67+
//! [`ptr::NonNull::dangling`].
68+
//!
69+
//! On top of these basic layout requirements, a `Box<T>` must point to a valid value of `T`.
6970
//!
7071
//! So long as `T: Sized`, a `Box<T>` is guaranteed to be represented
7172
//! as a single pointer and is also ABI-compatible with C pointers

0 commit comments

Comments
 (0)