From c06f5517dc00798c85ecad37504ebd0b29ede35a Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 30 Aug 2018 17:37:58 +0200 Subject: [PATCH] improve volatile comments --- src/libcore/ptr.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index cc42355643e3..6e664faa7306 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -774,8 +774,8 @@ pub unsafe fn write_unaligned(dst: *mut T, src: T) { /// to not be elided or reordered by the compiler across other volatile /// operations. /// -/// Memory read with `read_volatile` should almost always be written to using -/// [`write_volatile`]. +/// Memory accessed with `read_volatile` or [`write_volatile`] should not be +/// accessed with non-volatile operations. /// /// [`write_volatile`]: ./fn.write_volatile.html /// @@ -844,8 +844,8 @@ pub unsafe fn read_volatile(src: *const T) -> T { /// to not be elided or reordered by the compiler across other volatile /// operations. /// -/// Memory written with `write_volatile` should almost always be read from using -/// [`read_volatile`]. +/// Memory accessed with [`read_volatile`] or `write_volatile` should not be +/// accessed with non-volatile operations. /// /// `write_volatile` does not drop the contents of `dst`. This is safe, but it /// could leak allocations or resources, so care should be taken not to overwrite