Skip to content

Commit e30f8ae

Browse files
RalfJungcuviper
andauthored
mention null explicitly
Co-authored-by: Josh Stone <[email protected]>
1 parent 81af5b5 commit e30f8ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: library/core/src/ptr/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1991,7 +1991,7 @@ impl<F: FnPtr> fmt::Debug for F {
19911991
///
19921992
/// The `expr` in `addr_of!(expr)` is evaluated as a place expression, but never loads
19931993
/// from the place or requires the place to be dereferenceable. This means that
1994-
/// `addr_of!(*ptr)` is defined behavior even if `ptr` is dangling or misaligned.
1994+
/// `addr_of!(*ptr)` is defined behavior even if `ptr` is null, dangling, or misaligned.
19951995
/// Note however that `addr_of!((*ptr).field)` still requires the projection to
19961996
/// `field` to be in-bounds, using the same rules as [`offset`].
19971997
///
@@ -2040,7 +2040,7 @@ pub macro addr_of($place:expr) {
20402040
///
20412041
/// The `expr` in `addr_of_mut!(expr)` is evaluated as a place expression, but never loads
20422042
/// from the place or requires the place to be dereferenceable. This means that
2043-
/// `addr_of_mut!(*ptr)` is defined behavior even if `ptr` is dangling or misaligned.
2043+
/// `addr_of_mut!(*ptr)` is defined behavior even if `ptr` is null, dangling, or misaligned.
20442044
/// Note however that `addr_of_mut!((*ptr).field)` still requires the projection to
20452045
/// `field` to be in-bounds, using the same rules as [`offset`].
20462046
///

0 commit comments

Comments
 (0)