Skip to content

Commit

Permalink
tweak wording regarding Box validity
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Sep 1, 2024
1 parent 05ffd44 commit 0e5628d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions library/alloc/src/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0e5628d

Please sign in to comment.