Skip to content

Commit 351782d

Browse files
committed
Improve #Safety of core::ptr::replace
Added missing condition: `dst` must be readable
1 parent 302b9e4 commit 351782d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/ptr/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ unsafe fn swap_nonoverlapping_bytes(x: *mut u8, y: *mut u8, len: usize) {
471471
///
472472
/// Behavior is undefined if any of the following conditions are violated:
473473
///
474-
/// * `dst` must be [valid] for writes.
474+
/// * `dst` must be [valid] for both reads and writes.
475475
///
476476
/// * `dst` must be properly aligned.
477477
///

0 commit comments

Comments
 (0)