Skip to content

Commit

Permalink
mention null explicitly
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Stone <cuviper@gmail.com>
  • Loading branch information
RalfJung and cuviper authored Nov 10, 2023
1 parent 81af5b5 commit e30f8ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/core/src/ptr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1991,7 +1991,7 @@ impl<F: FnPtr> fmt::Debug for F {
///
/// The `expr` in `addr_of!(expr)` is evaluated as a place expression, but never loads
/// from the place or requires the place to be dereferenceable. This means that
/// `addr_of!(*ptr)` is defined behavior even if `ptr` is dangling or misaligned.
/// `addr_of!(*ptr)` is defined behavior even if `ptr` is null, dangling, or misaligned.
/// Note however that `addr_of!((*ptr).field)` still requires the projection to
/// `field` to be in-bounds, using the same rules as [`offset`].
///
Expand Down Expand Up @@ -2040,7 +2040,7 @@ pub macro addr_of($place:expr) {
///
/// The `expr` in `addr_of_mut!(expr)` is evaluated as a place expression, but never loads
/// from the place or requires the place to be dereferenceable. This means that
/// `addr_of_mut!(*ptr)` is defined behavior even if `ptr` is dangling or misaligned.
/// `addr_of_mut!(*ptr)` is defined behavior even if `ptr` is null, dangling, or misaligned.
/// Note however that `addr_of_mut!((*ptr).field)` still requires the projection to
/// `field` to be in-bounds, using the same rules as [`offset`].
///
Expand Down

0 comments on commit e30f8ae

Please sign in to comment.