@@ -114,7 +114,7 @@ pub use intrinsics::write_bytes;
114
114
/// again. [`write`] can be used to overwrite data without causing it to be
115
115
/// dropped.
116
116
///
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 .
118
118
///
119
119
/// [valid]: ../ptr/index.html#safety
120
120
/// [`Copy`]: ../marker/trait.Copy.html
@@ -205,7 +205,7 @@ pub const fn null_mut<T>() -> *mut T { 0 as *mut T }
205
205
///
206
206
/// * Both `x` and `y` must be properly aligned.
207
207
///
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 .
209
209
///
210
210
/// [valid]: ../ptr/index.html#safety
211
211
///
@@ -274,7 +274,7 @@ pub unsafe fn swap<T>(x: *mut T, y: *mut T) {
274
274
/// size_of::<T>()` bytes must *not* overlap with the region of memory
275
275
/// beginning at `y` with the same size.
276
276
///
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 .
278
278
///
279
279
/// [valid]: ../ptr/index.html#safety
280
280
///
@@ -387,7 +387,7 @@ unsafe fn swap_nonoverlapping_bytes(x: *mut u8, y: *mut u8, len: usize) {
387
387
///
388
388
/// * `dest` must be properly aligned.
389
389
///
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 .
391
391
///
392
392
/// [valid]: ../ptr/index.html#safety
393
393
///
@@ -426,7 +426,7 @@ pub unsafe fn replace<T>(dest: *mut T, mut src: T) -> T {
426
426
/// * `src` must be properly aligned. Use [`read_unaligned`] if this is not the
427
427
/// case.
428
428
///
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 .
430
430
///
431
431
/// ## Ownership of the Returned Value
432
432
///
@@ -542,7 +542,7 @@ pub unsafe fn read<T>(src: *const T) -> T {
542
542
/// whether `T` is [`Copy`]. If `T` is not [`Copy`], using both the returned
543
543
/// value and the value at `*src` can [violate memory safety][read-ownership].
544
544
///
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 .
546
546
///
547
547
/// [`Copy`]: ../marker/trait.Copy.html
548
548
/// [`read`]: ./fn.read.html
@@ -620,7 +620,7 @@ pub unsafe fn read_unaligned<T>(src: *const T) -> T {
620
620
/// * `dst` must be properly aligned. Use [`write_unaligned`] if this is not the
621
621
/// case.
622
622
///
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 .
624
624
///
625
625
/// [valid]: ../ptr/index.html#safety
626
626
/// [`write_unaligned`]: ./fn.write_unaligned.html
@@ -693,7 +693,7 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
693
693
///
694
694
/// * `dst` must be [valid] for writes.
695
695
///
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 .
697
697
///
698
698
/// [valid]: ../ptr/index.html#safety
699
699
///
@@ -778,7 +778,7 @@ pub unsafe fn write_unaligned<T>(dst: *mut T, src: T) {
778
778
/// However, storing non-[`Copy`] types in volatile memory is almost certainly
779
779
/// incorrect.
780
780
///
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 .
782
782
///
783
783
/// [valid]: ../ptr/index.html#safety
784
784
/// [`Copy`]: ../marker/trait.Copy.html
@@ -849,7 +849,7 @@ pub unsafe fn read_volatile<T>(src: *const T) -> T {
849
849
///
850
850
/// * `dst` must be properly aligned.
851
851
///
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 .
853
853
///
854
854
/// [valid]: ../ptr/index.html#safety
855
855
///
0 commit comments