Skip to content

Commit

Permalink
Improve #Safety of core::ptr::replace
Browse files Browse the repository at this point in the history
Added missing condition:
`dst` must be readable
  • Loading branch information
amosonn committed Feb 15, 2020
1 parent 302b9e4 commit 351782d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcore/ptr/mod.rs
Expand Up @@ -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.
///
Expand Down

0 comments on commit 351782d

Please sign in to comment.