about summary refs log tree commit diff
path: root/src/libcore/ptr
diff options
context:
space:
mode:
authorAmos Onn <amosonn@gmail.com>2020-01-31 15:18:27 +0100
committerAmos Onn <amosonn@gmail.com>2020-02-15 14:00:10 +0100
commit351782d30aaa6e15204e17ecdd51ac1e712685cf (patch)
treed3300805ab7b0fe944255ad14a9a66e16923ec32 /src/libcore/ptr
parent302b9e4b540cc352e75d3de6f803a99147107a50 (diff)
downloadrust-351782d30aaa6e15204e17ecdd51ac1e712685cf.tar.gz
rust-351782d30aaa6e15204e17ecdd51ac1e712685cf.zip
Improve #Safety of core::ptr::replace
Added missing condition:
`dst` must be readable
Diffstat (limited to 'src/libcore/ptr')
-rw-r--r--src/libcore/ptr/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcore/ptr/mod.rs b/src/libcore/ptr/mod.rs
index d465ab11c55..7faede44020 100644
--- a/src/libcore/ptr/mod.rs
+++ b/src/libcore/ptr/mod.rs
@@ -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.
 ///