@@ -114,7 +114,7 @@ pub use intrinsics::write_bytes;
114114/// again. [`write`] can be used to overwrite data without causing it to be
115115/// dropped.
116116///
117- /// These restrictions apply even if `T` has size `0`.
117+ /// Note that even if `T` has size `0`, the pointer must be non-NULL and properly aligned .
118118///
119119/// [valid]: ../ptr/index.html#safety
120120/// [`Copy`]: ../marker/trait.Copy.html
@@ -205,7 +205,7 @@ pub const fn null_mut<T>() -> *mut T { 0 as *mut T }
205205///
206206/// * Both `x` and `y` must be properly aligned.
207207///
208- /// These restrictions apply even if `T` has size `0`.
208+ /// Note that even if `T` has size `0`, the pointers must be non-NULL and properly aligned .
209209///
210210/// [valid]: ../ptr/index.html#safety
211211///
@@ -274,7 +274,7 @@ pub unsafe fn swap<T>(x: *mut T, y: *mut T) {
274274/// size_of::<T>()` bytes must *not* overlap with the region of memory
275275/// beginning at `y` with the same size.
276276///
277- /// These restrictions apply even if `T` has size `0`.
277+ /// Note that even if `T` has size `0`, the pointers must be non-NULL and properly aligned .
278278///
279279/// [valid]: ../ptr/index.html#safety
280280///
@@ -387,7 +387,7 @@ unsafe fn swap_nonoverlapping_bytes(x: *mut u8, y: *mut u8, len: usize) {
387387///
388388/// * `dest` must be properly aligned.
389389///
390- /// These restrictions apply even if `T` has size `0`.
390+ /// Note that even if `T` has size `0`, the pointer must be non-NULL and properly aligned .
391391///
392392/// [valid]: ../ptr/index.html#safety
393393///
@@ -426,7 +426,7 @@ pub unsafe fn replace<T>(dest: *mut T, mut src: T) -> T {
426426/// * `src` must be properly aligned. Use [`read_unaligned`] if this is not the
427427/// case.
428428///
429- /// These restrictions apply even if `T` has size `0`.
429+ /// Note that even if `T` has size `0`, the pointer must be non-NULL and properly aligned .
430430///
431431/// ## Ownership of the Returned Value
432432///
@@ -542,7 +542,7 @@ pub unsafe fn read<T>(src: *const T) -> T {
542542/// whether `T` is [`Copy`]. If `T` is not [`Copy`], using both the returned
543543/// value and the value at `*src` can [violate memory safety][read-ownership].
544544///
545- /// These restrictions apply even if `T` has size `0`.
545+ /// Note that even if `T` has size `0`, the pointer must be non-NULL and properly aligned .
546546///
547547/// [`Copy`]: ../marker/trait.Copy.html
548548/// [`read`]: ./fn.read.html
@@ -620,7 +620,7 @@ pub unsafe fn read_unaligned<T>(src: *const T) -> T {
620620/// * `dst` must be properly aligned. Use [`write_unaligned`] if this is not the
621621/// case.
622622///
623- /// These restrictions apply even if `T` has size `0`.
623+ /// Note that even if `T` has size `0`, the pointer must be non-NULL and properly aligned .
624624///
625625/// [valid]: ../ptr/index.html#safety
626626/// [`write_unaligned`]: ./fn.write_unaligned.html
@@ -693,7 +693,7 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
693693///
694694/// * `dst` must be [valid] for writes.
695695///
696- /// These restrictions apply even if `T` has size `0`.
696+ /// Note that even if `T` has size `0`, the pointer must be non-NULL and properly aligned .
697697///
698698/// [valid]: ../ptr/index.html#safety
699699///
@@ -778,7 +778,7 @@ pub unsafe fn write_unaligned<T>(dst: *mut T, src: T) {
778778/// However, storing non-[`Copy`] types in volatile memory is almost certainly
779779/// incorrect.
780780///
781- /// These restrictions apply even if `T` has size `0`.
781+ /// Note that even if `T` has size `0`, the pointer must be non-NULL and properly aligned .
782782///
783783/// [valid]: ../ptr/index.html#safety
784784/// [`Copy`]: ../marker/trait.Copy.html
@@ -849,7 +849,7 @@ pub unsafe fn read_volatile<T>(src: *const T) -> T {
849849///
850850/// * `dst` must be properly aligned.
851851///
852- /// These restrictions apply even if `T` has size `0`.
852+ /// Note that even if `T` has size `0`, the pointer must be non-NULL and properly aligned .
853853///
854854/// [valid]: ../ptr/index.html#safety
855855///
0 commit comments