Skip to content

Commit 96e3b63

Browse files
committed
docs: address review on wording
1 parent 80a4707 commit 96e3b63

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

library/core/src/ptr/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,18 +2033,18 @@ pub const unsafe fn write_unaligned<T>(dst: *mut T, src: T) {
20332033
/// semantics will almost always end up pretty similar to [C11's definition of volatile][c11].
20342034
///
20352035
/// Volatile operations are intended to act on I/O memory. As such, they are considered externally
2036-
/// observable events (just like syscalls), and are guaranteed to not be elided or reordered by the
2037-
/// compiler across other externally observable events. With this in mind, there are two cases of
2038-
/// usage that need to be distinguished:
2036+
/// observable events (just like syscalls, but less opaque), and are guaranteed to not be elided or
2037+
/// reordered by the compiler across other externally observable events. With this in mind, there
2038+
/// are two cases of usage that need to be distinguished:
20392039
///
20402040
/// - When a volatile operation is used for memory inside an [allocation], it behaves exactly like
20412041
/// [`read`], except for the additional guarantee that it won't be elided or reordered (see
20422042
/// above). This implies that the operation will actually access memory and not e.g. be lowered to
2043-
/// reusing data from a previous read, such as a register that performed a previous load on that
2044-
/// memory. Other than that, all the usual rules for memory accesses apply (including provenance).
2045-
/// In particular, just like in C, whether an operation is volatile has no bearing whatsoever on
2046-
/// questions involving concurrent access from multiple threads. Volatile accesses behave exactly
2047-
/// like non-atomic accesses in that regard.
2043+
/// reusing data from a previous read, such as from a register on which previous load of that
2044+
/// memory was performed. Other than that, all the usual rules for memory accesses apply
2045+
/// (including provenance). In particular, just like in C, whether an operation is volatile has
2046+
/// no bearing whatsoever on questions involving concurrent access from multiple threads. Volatile
2047+
/// accesses behave exactly like non-atomic accesses in that regard.
20482048
///
20492049
/// - Volatile operations, however, may also be used to access memory that is _outside_ of any Rust
20502050
/// allocation. In this use-case, the pointer does *not* have to be [valid] for reads. This is

0 commit comments

Comments
 (0)