From 7ad44c7c9c7feeca7df5358d7df26cc7cb10cf87 Mon Sep 17 00:00:00 2001 From: Arno Haase Date: Tue, 10 Sep 2019 14:18:16 +0200 Subject: [PATCH] documentation for AtomicPtr CAS operations --- src/libcore/sync/atomic.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index 8dfb19fa03296..a73111571c2b0 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -979,9 +979,8 @@ impl AtomicPtr { /// let some_ptr = AtomicPtr::new(ptr); /// /// let other_ptr = &mut 10; - /// let another_ptr = &mut 10; /// - /// let value = some_ptr.compare_and_swap(other_ptr, another_ptr, Ordering::Relaxed); + /// let value = some_ptr.compare_and_swap(ptr, other_ptr, Ordering::Relaxed); /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] @@ -1021,9 +1020,8 @@ impl AtomicPtr { /// let some_ptr = AtomicPtr::new(ptr); /// /// let other_ptr = &mut 10; - /// let another_ptr = &mut 10; /// - /// let value = some_ptr.compare_exchange(other_ptr, another_ptr, + /// let value = some_ptr.compare_exchange(ptr, other_ptr, /// Ordering::SeqCst, Ordering::Relaxed); /// ``` #[inline]