Skip to content

Commit 63c9e83

Browse files
RalfJunggitbot
authored and
gitbot
committed
ptr::copy: fix docs for the overlapping case
1 parent af0b33f commit 63c9e83

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

core/src/intrinsics/mod.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -4364,13 +4364,11 @@ pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: us
43644364
///
43654365
/// Behavior is undefined if any of the following conditions are violated:
43664366
///
4367-
/// * `src` must be [valid] for reads of `count * size_of::<T>()` bytes, and must remain valid even
4368-
/// when `dst` is written for `count * size_of::<T>()` bytes. (This means if the memory ranges
4369-
/// overlap, the two pointers must not be subject to aliasing restrictions relative to each
4370-
/// other.)
4367+
/// * `src` must be [valid] for reads of `count * size_of::<T>()` bytes.
43714368
///
43724369
/// * `dst` must be [valid] for writes of `count * size_of::<T>()` bytes, and must remain valid even
4373-
/// when `src` is read for `count * size_of::<T>()` bytes.
4370+
/// when `src` is read for `count * size_of::<T>()` bytes. (This means if the memory ranges
4371+
/// overlap, the `dst` pointer must not be invalidated by `src` reads.)
43744372
///
43754373
/// * Both `src` and `dst` must be properly aligned.
43764374
///

0 commit comments

Comments
 (0)