auto merge of #17766 : pminten/rust/atomic-int-in-examples, r=alexcrichton
The examples for fetch_or, fetch_and and fetch_xor for std::sync::atomic::AtomicInt used AtomicUint instead of AtomicInt.
This commit is contained in:
commit
dc987adfc1
1 changed files with 6 additions and 6 deletions
|
@ -382,9 +382,9 @@ impl AtomicInt {
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::sync::atomic::{AtomicUint, SeqCst};
|
/// use std::sync::atomic::{AtomicInt, SeqCst};
|
||||||
///
|
///
|
||||||
/// let foo = AtomicUint::new(0b101101);
|
/// let foo = AtomicInt::new(0b101101);
|
||||||
/// assert_eq!(0b101101, foo.fetch_and(0b110011, SeqCst));
|
/// assert_eq!(0b101101, foo.fetch_and(0b110011, SeqCst));
|
||||||
/// assert_eq!(0b100001, foo.load(SeqCst));
|
/// assert_eq!(0b100001, foo.load(SeqCst));
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -397,9 +397,9 @@ impl AtomicInt {
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::sync::atomic::{AtomicUint, SeqCst};
|
/// use std::sync::atomic::{AtomicInt, SeqCst};
|
||||||
///
|
///
|
||||||
/// let foo = AtomicUint::new(0b101101);
|
/// let foo = AtomicInt::new(0b101101);
|
||||||
/// assert_eq!(0b101101, foo.fetch_or(0b110011, SeqCst));
|
/// assert_eq!(0b101101, foo.fetch_or(0b110011, SeqCst));
|
||||||
/// assert_eq!(0b111111, foo.load(SeqCst));
|
/// assert_eq!(0b111111, foo.load(SeqCst));
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -412,9 +412,9 @@ impl AtomicInt {
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use std::sync::atomic::{AtomicUint, SeqCst};
|
/// use std::sync::atomic::{AtomicInt, SeqCst};
|
||||||
///
|
///
|
||||||
/// let foo = AtomicUint::new(0b101101);
|
/// let foo = AtomicInt::new(0b101101);
|
||||||
/// assert_eq!(0b101101, foo.fetch_xor(0b110011, SeqCst));
|
/// assert_eq!(0b101101, foo.fetch_xor(0b110011, SeqCst));
|
||||||
/// assert_eq!(0b011110, foo.load(SeqCst));
|
/// assert_eq!(0b011110, foo.load(SeqCst));
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue