Skip to content

Commit c06f551

Browse files
committed
improve volatile comments
1 parent d97f61f commit c06f551

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libcore/ptr.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -774,8 +774,8 @@ pub unsafe fn write_unaligned<T>(dst: *mut T, src: T) {
774774
/// to not be elided or reordered by the compiler across other volatile
775775
/// operations.
776776
///
777-
/// Memory read with `read_volatile` should almost always be written to using
778-
/// [`write_volatile`].
777+
/// Memory accessed with `read_volatile` or [`write_volatile`] should not be
778+
/// accessed with non-volatile operations.
779779
///
780780
/// [`write_volatile`]: ./fn.write_volatile.html
781781
///
@@ -844,8 +844,8 @@ pub unsafe fn read_volatile<T>(src: *const T) -> T {
844844
/// to not be elided or reordered by the compiler across other volatile
845845
/// operations.
846846
///
847-
/// Memory written with `write_volatile` should almost always be read from using
848-
/// [`read_volatile`].
847+
/// Memory accessed with [`read_volatile`] or `write_volatile` should not be
848+
/// accessed with non-volatile operations.
849849
///
850850
/// `write_volatile` does not drop the contents of `dst`. This is safe, but it
851851
/// could leak allocations or resources, so care should be taken not to overwrite

0 commit comments

Comments
 (0)