1
Fork 0

Improve #Safety of core::ptr::replace

Added missing condition:
`dst` must be readable
This commit is contained in:
Amos Onn 2020-01-31 15:18:27 +01:00
parent 302b9e4b54
commit 351782d30a

View file

@ -471,7 +471,7 @@ unsafe fn swap_nonoverlapping_bytes(x: *mut u8, y: *mut u8, len: usize) {
///
/// Behavior is undefined if any of the following conditions are violated:
///
/// * `dst` must be [valid] for writes.
/// * `dst` must be [valid] for both reads and writes.
///
/// * `dst` must be properly aligned.
///