diff options
| author | Amos Onn <amosonn@gmail.com> | 2020-02-15 13:58:54 +0100 |
|---|---|---|
| committer | Amos Onn <amosonn@gmail.com> | 2020-02-15 13:58:54 +0100 |
| commit | 302b9e4b540cc352e75d3de6f803a99147107a50 (patch) | |
| tree | 8adcfae21834cb044be386030df679268a6eb2b1 /src/libcore/ptr | |
| parent | 433aae93e4ef866a1fdfefad136b32ed89acd3e7 (diff) | |
| download | rust-302b9e4b540cc352e75d3de6f803a99147107a50.tar.gz rust-302b9e4b540cc352e75d3de6f803a99147107a50.zip | |
Improve #Safety in various methods in core::ptr
s/for reads and writes/for both ...
Diffstat (limited to 'src/libcore/ptr')
| -rw-r--r-- | src/libcore/ptr/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/ptr/mod.rs b/src/libcore/ptr/mod.rs index 0ee50966f96..d465ab11c55 100644 --- a/src/libcore/ptr/mod.rs +++ b/src/libcore/ptr/mod.rs @@ -289,7 +289,7 @@ pub const fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T] { /// /// Behavior is undefined if any of the following conditions are violated: /// -/// * Both `x` and `y` must be [valid] for reads and writes. +/// * Both `x` and `y` must be [valid] for both reads and writes. /// /// * Both `x` and `y` must be properly aligned. /// @@ -355,7 +355,7 @@ pub unsafe fn swap<T>(x: *mut T, y: *mut T) { /// /// Behavior is undefined if any of the following conditions are violated: /// -/// * Both `x` and `y` must be [valid] for reads and writes of `count * +/// * Both `x` and `y` must be [valid] for both reads and writes of `count * /// size_of::<T>()` bytes. /// /// * Both `x` and `y` must be properly aligned. |
