Skip to content

Commit 1c78478

Browse files
committed
rollup merge of #23793: steveklabnik/gh21668
Fixes #21668
2 parents 828c369 + 1a6188a commit 1c78478

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/libcore/atomic.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ impl AtomicBool {
252252

253253
/// Stores a value into the bool if the current value is the same as the expected value.
254254
///
255-
/// If the return value is equal to `old` then the value was updated.
255+
/// The return value is always the previous value. If it is equal to `old`, then the value was
256+
/// updated.
256257
///
257258
/// `swap` also takes an `Ordering` argument which describes the memory ordering of this
258259
/// operation.
@@ -489,7 +490,8 @@ impl AtomicIsize {
489490

490491
/// Stores a value into the isize if the current value is the same as the expected value.
491492
///
492-
/// If the return value is equal to `old` then the value was updated.
493+
/// The return value is always the previous value. If it is equal to `old`, then the value was
494+
/// updated.
493495
///
494496
/// `compare_and_swap` also takes an `Ordering` argument which describes the memory ordering of
495497
/// this operation.
@@ -676,7 +678,8 @@ impl AtomicUsize {
676678

677679
/// Stores a value into the usize if the current value is the same as the expected value.
678680
///
679-
/// If the return value is equal to `old` then the value was updated.
681+
/// The return value is always the previous value. If it is equal to `old`, then the value was
682+
/// updated.
680683
///
681684
/// `compare_and_swap` also takes an `Ordering` argument which describes the memory ordering of
682685
/// this operation.
@@ -873,7 +876,8 @@ impl<T> AtomicPtr<T> {
873876

874877
/// Stores a value into the pointer if the current value is the same as the expected value.
875878
///
876-
/// If the return value is equal to `old` then the value was updated.
879+
/// The return value is always the previous value. If it is equal to `old`, then the value was
880+
/// updated.
877881
///
878882
/// `compare_and_swap` also takes an `Ordering` argument which describes the memory ordering of
879883
/// this operation.

0 commit comments

Comments
 (0)