about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Hall <peter.hall@hyperexponential.com>2024-02-14 12:13:25 +0000
committerPeter Hall <peter.hall@hyperexponential.com>2024-02-14 20:14:45 +0000
commit9cccf208997e0e8a9909b9d174be7b8b3e4f6e83 (patch)
tree741e81131aae278d6e81a37dcfecb88f71c29e6a
parent81b757c670483604c5ad04370bc505ba3d21356a (diff)
downloadrust-9cccf208997e0e8a9909b9d174be7b8b3e4f6e83.tar.gz
rust-9cccf208997e0e8a9909b9d174be7b8b3e4f6e83.zip
Clarified docs on non-atomic oprations on owned/mut refs to atomics
-rw-r--r--library/core/src/sync/atomic.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/library/core/src/sync/atomic.rs b/library/core/src/sync/atomic.rs
index 1dec2bf40cc..e9a0d9e1d28 100644
--- a/library/core/src/sync/atomic.rs
+++ b/library/core/src/sync/atomic.rs
@@ -27,8 +27,9 @@
 //! Rust atomics currently follow the same rules as [C++20 atomics][cpp], specifically `atomic_ref`.
 //! Basically, creating a *shared reference* to one of the Rust atomic types corresponds to creating
 //! an `atomic_ref` in C++; the `atomic_ref` is destroyed when the lifetime of the shared reference
-//! ends. (A Rust atomic type that is exclusively owned or behind a mutable reference does *not*
-//! correspond to an "atomic object" in C++, since it can be accessed via non-atomic operations.)
+//! ends. A Rust atomic type that is exclusively owned or behind a mutable reference does *not*
+//! correspond to an “atomic object” in C++, since the underlying primitive can be mutably accessed,
+//! for example with `get_mut`, to perform non-atomic operations.
 //!
 //! [cpp]: https://en.cppreference.com/w/cpp/atomic
 //!