From deae8de673af638537421804b360443af76d55e4 Mon Sep 17 00:00:00 2001 From: steveklabnik Date: Mon, 19 Mar 2018 14:33:39 +0100 Subject: [PATCH 1/2] Clarify AcqRel's docs This implied things that are not true. Fixes #49127 --- src/libcore/sync/atomic.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index 25827edee7d..fd6e5140a09 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -205,8 +205,9 @@ pub enum Ordering { /// [`Release`]: http://llvm.org/docs/Atomics.html#release #[stable(feature = "rust1", since = "1.0.0")] Acquire, - /// When coupled with a load, uses [`Acquire`] ordering, and with a store - /// [`Release`] ordering. + /// Has the effects of both [`Acquire`] and [`Release`] together. + /// + /// If you only are concerned about a load or a store, consider using one of those instead. /// /// [`Acquire`]: http://llvm.org/docs/Atomics.html#acquire /// [`Release`]: http://llvm.org/docs/Atomics.html#release From 23013c791c70a297b430e9d1c0408493705d36e0 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Sun, 25 Mar 2018 14:19:27 +0200 Subject: [PATCH 2/2] update wording as per feedback --- src/libcore/sync/atomic.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index fd6e5140a09..c1f6c492e98 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -207,7 +207,9 @@ pub enum Ordering { Acquire, /// Has the effects of both [`Acquire`] and [`Release`] together. /// - /// If you only are concerned about a load or a store, consider using one of those instead. + /// This ordering is only applicable for operations that combine both loads and stores. + /// + /// For loads it uses [`Acquire`] ordering. For stores it uses the [`Release`] ordering. /// /// [`Acquire`]: http://llvm.org/docs/Atomics.html#acquire /// [`Release`]: http://llvm.org/docs/Atomics.html#release