Skip to content

Commit 302b9e4

Browse files
committed
Improve #Safety in various methods in core::ptr
s/for reads and writes/for both ...
1 parent 433aae9 commit 302b9e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/ptr/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ pub const fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T] {
289289
///
290290
/// Behavior is undefined if any of the following conditions are violated:
291291
///
292-
/// * Both `x` and `y` must be [valid] for reads and writes.
292+
/// * Both `x` and `y` must be [valid] for both reads and writes.
293293
///
294294
/// * Both `x` and `y` must be properly aligned.
295295
///
@@ -355,7 +355,7 @@ pub unsafe fn swap<T>(x: *mut T, y: *mut T) {
355355
///
356356
/// Behavior is undefined if any of the following conditions are violated:
357357
///
358-
/// * Both `x` and `y` must be [valid] for reads and writes of `count *
358+
/// * Both `x` and `y` must be [valid] for both reads and writes of `count *
359359
/// size_of::<T>()` bytes.
360360
///
361361
/// * Both `x` and `y` must be properly aligned.

0 commit comments

Comments
 (0)