Stabilize atomic_try_update
and deprecate fetch_update starting 1.99.0
This commit is contained in:
parent
94a0cd15f5
commit
3a48b9fe1a
11 changed files with 141 additions and 282 deletions
|
|
@ -3270,7 +3270,7 @@ impl<T: ?Sized, A: Allocator> Weak<T, A> {
|
|||
// Acquire is necessary for the success case to synchronise with `Arc::new_cyclic`, when the inner
|
||||
// value can be initialized after `Weak` references have already been created. In that case, we
|
||||
// expect to observe the fully initialized value.
|
||||
if self.inner()?.strong.fetch_update(Acquire, Relaxed, checked_increment).is_ok() {
|
||||
if self.inner()?.strong.try_update(Acquire, Relaxed, checked_increment).is_ok() {
|
||||
// SAFETY: pointer is not null, verified in checked_increment
|
||||
unsafe { Some(Arc::from_inner_in(self.ptr, self.alloc.clone())) }
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ use crate::{cmp, ptr};
|
|||
/// let mut allocated = 0;
|
||||
/// if self
|
||||
/// .remaining
|
||||
/// .fetch_update(Relaxed, Relaxed, |mut remaining| {
|
||||
/// .try_update(Relaxed, Relaxed, |mut remaining| {
|
||||
/// if size > remaining {
|
||||
/// return None;
|
||||
/// }
|
||||
|
|
|
|||
|
|
@ -1287,73 +1287,27 @@ impl AtomicBool {
|
|||
self.v.get().cast()
|
||||
}
|
||||
|
||||
/// Fetches the value, and applies a function to it that returns an optional
|
||||
/// new value. Returns a `Result` of `Ok(previous_value)` if the function
|
||||
/// returned `Some(_)`, else `Err(previous_value)`.
|
||||
///
|
||||
/// Note: This may call the function multiple times if the value has been
|
||||
/// changed from other threads in the meantime, as long as the function
|
||||
/// returns `Some(_)`, but the function will have been applied only once to
|
||||
/// the stored value.
|
||||
///
|
||||
/// `fetch_update` takes two [`Ordering`] arguments to describe the memory
|
||||
/// ordering of this operation. The first describes the required ordering for
|
||||
/// when the operation finally succeeds while the second describes the
|
||||
/// required ordering for loads. These correspond to the success and failure
|
||||
/// orderings of [`AtomicBool::compare_exchange`] respectively.
|
||||
///
|
||||
/// Using [`Acquire`] as success ordering makes the store part of this
|
||||
/// operation [`Relaxed`], and using [`Release`] makes the final successful
|
||||
/// load [`Relaxed`]. The (failed) load ordering can only be [`SeqCst`],
|
||||
/// [`Acquire`] or [`Relaxed`].
|
||||
///
|
||||
/// **Note:** This method is only available on platforms that support atomic
|
||||
/// operations on `u8`.
|
||||
///
|
||||
/// # Considerations
|
||||
///
|
||||
/// This method is not magic; it is not provided by the hardware, and does not act like a
|
||||
/// critical section or mutex.
|
||||
///
|
||||
/// It is implemented on top of an atomic [compare-and-swap operation], and thus is subject to
|
||||
/// the usual drawbacks of CAS operations. In particular, be careful of the [ABA problem].
|
||||
///
|
||||
/// [ABA Problem]: https://en.wikipedia.org/wiki/ABA_problem
|
||||
/// [compare-and-swap operation]: https://en.wikipedia.org/wiki/Compare-and-swap
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::sync::atomic::{AtomicBool, Ordering};
|
||||
///
|
||||
/// let x = AtomicBool::new(false);
|
||||
/// assert_eq!(x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |_| None), Err(false));
|
||||
/// assert_eq!(x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| Some(!x)), Ok(false));
|
||||
/// assert_eq!(x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| Some(!x)), Ok(true));
|
||||
/// assert_eq!(x.load(Ordering::SeqCst), false);
|
||||
/// ```
|
||||
/// An alias for [`AtomicBool::try_update`].
|
||||
#[inline]
|
||||
#[stable(feature = "atomic_fetch_update", since = "1.53.0")]
|
||||
#[cfg(target_has_atomic = "8")]
|
||||
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
|
||||
#[rustc_should_not_be_called_on_const_items]
|
||||
#[deprecated(
|
||||
since = "1.99.0",
|
||||
note = "renamed to `try_update` for consistency",
|
||||
suggestion = "try_update"
|
||||
)]
|
||||
pub fn fetch_update<F>(
|
||||
&self,
|
||||
set_order: Ordering,
|
||||
fetch_order: Ordering,
|
||||
mut f: F,
|
||||
f: F,
|
||||
) -> Result<bool, bool>
|
||||
where
|
||||
F: FnMut(bool) -> Option<bool>,
|
||||
{
|
||||
let mut prev = self.load(fetch_order);
|
||||
while let Some(next) = f(prev) {
|
||||
match self.compare_exchange_weak(prev, next, set_order, fetch_order) {
|
||||
x @ Ok(_) => return x,
|
||||
Err(next_prev) => prev = next_prev,
|
||||
}
|
||||
}
|
||||
Err(prev)
|
||||
self.try_update(set_order, fetch_order, f)
|
||||
}
|
||||
|
||||
/// Fetches the value, and applies a function to it that returns an optional
|
||||
|
|
@ -1395,7 +1349,6 @@ impl AtomicBool {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// #![feature(atomic_try_update)]
|
||||
/// use std::sync::atomic::{AtomicBool, Ordering};
|
||||
///
|
||||
/// let x = AtomicBool::new(false);
|
||||
|
|
@ -1405,7 +1358,7 @@ impl AtomicBool {
|
|||
/// assert_eq!(x.load(Ordering::SeqCst), false);
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "atomic_try_update", issue = "135894")]
|
||||
#[stable(feature = "atomic_try_update", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[cfg(target_has_atomic = "8")]
|
||||
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
|
||||
#[rustc_should_not_be_called_on_const_items]
|
||||
|
|
@ -1413,11 +1366,16 @@ impl AtomicBool {
|
|||
&self,
|
||||
set_order: Ordering,
|
||||
fetch_order: Ordering,
|
||||
f: impl FnMut(bool) -> Option<bool>,
|
||||
mut f: impl FnMut(bool) -> Option<bool>,
|
||||
) -> Result<bool, bool> {
|
||||
// FIXME(atomic_try_update): this is currently an unstable alias to `fetch_update`;
|
||||
// when stabilizing, turn `fetch_update` into a deprecated alias to `try_update`.
|
||||
self.fetch_update(set_order, fetch_order, f)
|
||||
let mut prev = self.load(fetch_order);
|
||||
while let Some(next) = f(prev) {
|
||||
match self.compare_exchange_weak(prev, next, set_order, fetch_order) {
|
||||
x @ Ok(_) => return x,
|
||||
Err(next_prev) => prev = next_prev,
|
||||
}
|
||||
}
|
||||
Err(prev)
|
||||
}
|
||||
|
||||
/// Fetches the value, applies a function to it that it return a new value.
|
||||
|
|
@ -1454,7 +1412,6 @@ impl AtomicBool {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// #![feature(atomic_try_update)]
|
||||
///
|
||||
/// use std::sync::atomic::{AtomicBool, Ordering};
|
||||
///
|
||||
|
|
@ -1464,7 +1421,7 @@ impl AtomicBool {
|
|||
/// assert_eq!(x.load(Ordering::SeqCst), false);
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "atomic_try_update", issue = "135894")]
|
||||
#[stable(feature = "atomic_try_update", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[cfg(target_has_atomic = "8")]
|
||||
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
|
||||
#[rustc_should_not_be_called_on_const_items]
|
||||
|
|
@ -2000,83 +1957,27 @@ impl<T> AtomicPtr<T> {
|
|||
unsafe { atomic_compare_exchange_weak(self.p.get(), current, new, success, failure) }
|
||||
}
|
||||
|
||||
/// Fetches the value, and applies a function to it that returns an optional
|
||||
/// new value. Returns a `Result` of `Ok(previous_value)` if the function
|
||||
/// returned `Some(_)`, else `Err(previous_value)`.
|
||||
///
|
||||
/// Note: This may call the function multiple times if the value has been
|
||||
/// changed from other threads in the meantime, as long as the function
|
||||
/// returns `Some(_)`, but the function will have been applied only once to
|
||||
/// the stored value.
|
||||
///
|
||||
/// `fetch_update` takes two [`Ordering`] arguments to describe the memory
|
||||
/// ordering of this operation. The first describes the required ordering for
|
||||
/// when the operation finally succeeds while the second describes the
|
||||
/// required ordering for loads. These correspond to the success and failure
|
||||
/// orderings of [`AtomicPtr::compare_exchange`] respectively.
|
||||
///
|
||||
/// Using [`Acquire`] as success ordering makes the store part of this
|
||||
/// operation [`Relaxed`], and using [`Release`] makes the final successful
|
||||
/// load [`Relaxed`]. The (failed) load ordering can only be [`SeqCst`],
|
||||
/// [`Acquire`] or [`Relaxed`].
|
||||
///
|
||||
/// **Note:** This method is only available on platforms that support atomic
|
||||
/// operations on pointers.
|
||||
///
|
||||
/// # Considerations
|
||||
///
|
||||
/// This method is not magic; it is not provided by the hardware, and does not act like a
|
||||
/// critical section or mutex.
|
||||
///
|
||||
/// It is implemented on top of an atomic [compare-and-swap operation], and thus is subject to
|
||||
/// the usual drawbacks of CAS operations. In particular, be careful of the [ABA problem],
|
||||
/// which is a particularly common pitfall for pointers!
|
||||
///
|
||||
/// [ABA Problem]: https://en.wikipedia.org/wiki/ABA_problem
|
||||
/// [compare-and-swap operation]: https://en.wikipedia.org/wiki/Compare-and-swap
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::sync::atomic::{AtomicPtr, Ordering};
|
||||
///
|
||||
/// let ptr: *mut _ = &mut 5;
|
||||
/// let some_ptr = AtomicPtr::new(ptr);
|
||||
///
|
||||
/// let new: *mut _ = &mut 10;
|
||||
/// assert_eq!(some_ptr.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |_| None), Err(ptr));
|
||||
/// let result = some_ptr.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| {
|
||||
/// if x == ptr {
|
||||
/// Some(new)
|
||||
/// } else {
|
||||
/// None
|
||||
/// }
|
||||
/// });
|
||||
/// assert_eq!(result, Ok(ptr));
|
||||
/// assert_eq!(some_ptr.load(Ordering::SeqCst), new);
|
||||
/// ```
|
||||
/// An alias for [`AtomicPtr::try_update`].
|
||||
#[inline]
|
||||
#[stable(feature = "atomic_fetch_update", since = "1.53.0")]
|
||||
#[cfg(target_has_atomic = "ptr")]
|
||||
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
|
||||
#[rustc_should_not_be_called_on_const_items]
|
||||
#[deprecated(
|
||||
since = "1.99.0",
|
||||
note = "renamed to `try_update` for consistency",
|
||||
suggestion = "try_update"
|
||||
)]
|
||||
pub fn fetch_update<F>(
|
||||
&self,
|
||||
set_order: Ordering,
|
||||
fetch_order: Ordering,
|
||||
mut f: F,
|
||||
f: F,
|
||||
) -> Result<*mut T, *mut T>
|
||||
where
|
||||
F: FnMut(*mut T) -> Option<*mut T>,
|
||||
{
|
||||
let mut prev = self.load(fetch_order);
|
||||
while let Some(next) = f(prev) {
|
||||
match self.compare_exchange_weak(prev, next, set_order, fetch_order) {
|
||||
x @ Ok(_) => return x,
|
||||
Err(next_prev) => prev = next_prev,
|
||||
}
|
||||
}
|
||||
Err(prev)
|
||||
self.try_update(set_order, fetch_order, f)
|
||||
}
|
||||
/// Fetches the value, and applies a function to it that returns an optional
|
||||
/// new value. Returns a `Result` of `Ok(previous_value)` if the function
|
||||
|
|
@ -2118,7 +2019,6 @@ impl<T> AtomicPtr<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// #![feature(atomic_try_update)]
|
||||
/// use std::sync::atomic::{AtomicPtr, Ordering};
|
||||
///
|
||||
/// let ptr: *mut _ = &mut 5;
|
||||
|
|
@ -2137,7 +2037,7 @@ impl<T> AtomicPtr<T> {
|
|||
/// assert_eq!(some_ptr.load(Ordering::SeqCst), new);
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "atomic_try_update", issue = "135894")]
|
||||
#[stable(feature = "atomic_try_update", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[cfg(target_has_atomic = "ptr")]
|
||||
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
|
||||
#[rustc_should_not_be_called_on_const_items]
|
||||
|
|
@ -2145,11 +2045,16 @@ impl<T> AtomicPtr<T> {
|
|||
&self,
|
||||
set_order: Ordering,
|
||||
fetch_order: Ordering,
|
||||
f: impl FnMut(*mut T) -> Option<*mut T>,
|
||||
mut f: impl FnMut(*mut T) -> Option<*mut T>,
|
||||
) -> Result<*mut T, *mut T> {
|
||||
// FIXME(atomic_try_update): this is currently an unstable alias to `fetch_update`;
|
||||
// when stabilizing, turn `fetch_update` into a deprecated alias to `try_update`.
|
||||
self.fetch_update(set_order, fetch_order, f)
|
||||
let mut prev = self.load(fetch_order);
|
||||
while let Some(next) = f(prev) {
|
||||
match self.compare_exchange_weak(prev, next, set_order, fetch_order) {
|
||||
x @ Ok(_) => return x,
|
||||
Err(next_prev) => prev = next_prev,
|
||||
}
|
||||
}
|
||||
Err(prev)
|
||||
}
|
||||
|
||||
/// Fetches the value, applies a function to it that it return a new value.
|
||||
|
|
@ -2188,7 +2093,6 @@ impl<T> AtomicPtr<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// #![feature(atomic_try_update)]
|
||||
///
|
||||
/// use std::sync::atomic::{AtomicPtr, Ordering};
|
||||
///
|
||||
|
|
@ -2201,7 +2105,7 @@ impl<T> AtomicPtr<T> {
|
|||
/// assert_eq!(some_ptr.load(Ordering::SeqCst), new);
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "atomic_try_update", issue = "135894")]
|
||||
#[stable(feature = "atomic_try_update", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[cfg(target_has_atomic = "8")]
|
||||
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
|
||||
#[rustc_should_not_be_called_on_const_items]
|
||||
|
|
@ -3399,69 +3303,25 @@ macro_rules! atomic_int {
|
|||
unsafe { atomic_xor(self.v.get(), val, order) }
|
||||
}
|
||||
|
||||
/// Fetches the value, and applies a function to it that returns an optional
|
||||
/// new value. Returns a `Result` of `Ok(previous_value)` if the function returned `Some(_)`, else
|
||||
/// `Err(previous_value)`.
|
||||
///
|
||||
/// Note: This may call the function multiple times if the value has been changed from other threads in
|
||||
/// the meantime, as long as the function returns `Some(_)`, but the function will have been applied
|
||||
/// only once to the stored value.
|
||||
///
|
||||
/// `fetch_update` takes two [`Ordering`] arguments to describe the memory ordering of this operation.
|
||||
/// The first describes the required ordering for when the operation finally succeeds while the second
|
||||
/// describes the required ordering for loads. These correspond to the success and failure orderings of
|
||||
#[doc = concat!("[`", stringify!($atomic_type), "::compare_exchange`]")]
|
||||
/// respectively.
|
||||
///
|
||||
/// Using [`Acquire`] as success ordering makes the store part
|
||||
/// of this operation [`Relaxed`], and using [`Release`] makes the final successful load
|
||||
/// [`Relaxed`]. The (failed) load ordering can only be [`SeqCst`], [`Acquire`] or [`Relaxed`].
|
||||
///
|
||||
/// **Note**: This method is only available on platforms that support atomic operations on
|
||||
#[doc = concat!("[`", $s_int_type, "`].")]
|
||||
///
|
||||
/// # Considerations
|
||||
///
|
||||
/// This method is not magic; it is not provided by the hardware, and does not act like a
|
||||
/// critical section or mutex.
|
||||
///
|
||||
/// It is implemented on top of an atomic [compare-and-swap operation], and thus is subject to
|
||||
/// the usual drawbacks of CAS operations. In particular, be careful of the [ABA problem]
|
||||
/// if this atomic integer is an index or more generally if knowledge of only the *bitwise value*
|
||||
/// of the atomic is not in and of itself sufficient to ensure any required preconditions.
|
||||
///
|
||||
/// [ABA Problem]: https://en.wikipedia.org/wiki/ABA_problem
|
||||
/// [compare-and-swap operation]: https://en.wikipedia.org/wiki/Compare-and-swap
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
#[doc = concat!($extra_feature, "use std::sync::atomic::{", stringify!($atomic_type), ", Ordering};")]
|
||||
///
|
||||
#[doc = concat!("let x = ", stringify!($atomic_type), "::new(7);")]
|
||||
/// assert_eq!(x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |_| None), Err(7));
|
||||
/// assert_eq!(x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| Some(x + 1)), Ok(7));
|
||||
/// assert_eq!(x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| Some(x + 1)), Ok(8));
|
||||
/// assert_eq!(x.load(Ordering::SeqCst), 9);
|
||||
/// ```
|
||||
/// An alias for
|
||||
#[doc = concat!("[`", stringify!($atomic_type), "::try_update`]")]
|
||||
/// .
|
||||
#[inline]
|
||||
#[stable(feature = "no_more_cas", since = "1.45.0")]
|
||||
#[$cfg_cas]
|
||||
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
|
||||
#[rustc_should_not_be_called_on_const_items]
|
||||
#[deprecated(
|
||||
since = "1.99.0",
|
||||
note = "renamed to `try_update` for consistency",
|
||||
suggestion = "try_update"
|
||||
)]
|
||||
pub fn fetch_update<F>(&self,
|
||||
set_order: Ordering,
|
||||
fetch_order: Ordering,
|
||||
mut f: F) -> Result<$int_type, $int_type>
|
||||
f: F) -> Result<$int_type, $int_type>
|
||||
where F: FnMut($int_type) -> Option<$int_type> {
|
||||
let mut prev = self.load(fetch_order);
|
||||
while let Some(next) = f(prev) {
|
||||
match self.compare_exchange_weak(prev, next, set_order, fetch_order) {
|
||||
x @ Ok(_) => return x,
|
||||
Err(next_prev) => prev = next_prev
|
||||
}
|
||||
}
|
||||
Err(prev)
|
||||
self.try_update(set_order, fetch_order, f)
|
||||
}
|
||||
|
||||
/// Fetches the value, and applies a function to it that returns an optional
|
||||
|
|
@ -3503,7 +3363,6 @@ macro_rules! atomic_int {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// #![feature(atomic_try_update)]
|
||||
#[doc = concat!($extra_feature, "use std::sync::atomic::{", stringify!($atomic_type), ", Ordering};")]
|
||||
///
|
||||
#[doc = concat!("let x = ", stringify!($atomic_type), "::new(7);")]
|
||||
|
|
@ -3513,7 +3372,7 @@ macro_rules! atomic_int {
|
|||
/// assert_eq!(x.load(Ordering::SeqCst), 9);
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "atomic_try_update", issue = "135894")]
|
||||
#[stable(feature = "atomic_try_update", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[$cfg_cas]
|
||||
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
|
||||
#[rustc_should_not_be_called_on_const_items]
|
||||
|
|
@ -3521,11 +3380,16 @@ macro_rules! atomic_int {
|
|||
&self,
|
||||
set_order: Ordering,
|
||||
fetch_order: Ordering,
|
||||
f: impl FnMut($int_type) -> Option<$int_type>,
|
||||
mut f: impl FnMut($int_type) -> Option<$int_type>,
|
||||
) -> Result<$int_type, $int_type> {
|
||||
// FIXME(atomic_try_update): this is currently an unstable alias to `fetch_update`;
|
||||
// when stabilizing, turn `fetch_update` into a deprecated alias to `try_update`.
|
||||
self.fetch_update(set_order, fetch_order, f)
|
||||
let mut prev = self.load(fetch_order);
|
||||
while let Some(next) = f(prev) {
|
||||
match self.compare_exchange_weak(prev, next, set_order, fetch_order) {
|
||||
x @ Ok(_) => return x,
|
||||
Err(next_prev) => prev = next_prev
|
||||
}
|
||||
}
|
||||
Err(prev)
|
||||
}
|
||||
|
||||
/// Fetches the value, applies a function to it that it return a new value.
|
||||
|
|
@ -3566,7 +3430,6 @@ macro_rules! atomic_int {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// #![feature(atomic_try_update)]
|
||||
#[doc = concat!($extra_feature, "use std::sync::atomic::{", stringify!($atomic_type), ", Ordering};")]
|
||||
///
|
||||
#[doc = concat!("let x = ", stringify!($atomic_type), "::new(7);")]
|
||||
|
|
@ -3575,7 +3438,7 @@ macro_rules! atomic_int {
|
|||
/// assert_eq!(x.load(Ordering::SeqCst), 9);
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "atomic_try_update", issue = "135894")]
|
||||
#[stable(feature = "atomic_try_update", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[$cfg_cas]
|
||||
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
|
||||
#[rustc_should_not_be_called_on_const_items]
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ impl Condvar {
|
|||
// possible for `counter` to decrease due to a condvar timing out, in which
|
||||
// case the corresponding `timed_out` will increase accordingly.
|
||||
let Ok(waiter_count) =
|
||||
self.counter.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |counter| {
|
||||
self.counter.try_update(Ordering::Relaxed, Ordering::Relaxed, |counter| {
|
||||
if counter == 0 {
|
||||
return None;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ impl RwLock {
|
|||
#[inline]
|
||||
pub fn try_read(&self) -> bool {
|
||||
self.state
|
||||
.fetch_update(Acquire, Relaxed, |s| is_read_lockable(s).then(|| s + READ_LOCKED))
|
||||
.try_update(Acquire, Relaxed, |s| is_read_lockable(s).then(|| s + READ_LOCKED))
|
||||
.is_ok()
|
||||
}
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ impl RwLock {
|
|||
#[inline]
|
||||
pub fn try_write(&self) -> bool {
|
||||
self.state
|
||||
.fetch_update(Acquire, Relaxed, |s| is_unlocked(s).then(|| s + WRITE_LOCKED))
|
||||
.try_update(Acquire, Relaxed, |s| is_unlocked(s).then(|| s + WRITE_LOCKED))
|
||||
.is_ok()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ impl RwLock {
|
|||
|
||||
#[inline]
|
||||
pub fn try_read(&self) -> bool {
|
||||
self.state.fetch_update(Acquire, Relaxed, read_lock).is_ok()
|
||||
self.state.try_update(Acquire, Relaxed, read_lock).is_ok()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
@ -343,7 +343,7 @@ impl RwLock {
|
|||
pub fn try_write(&self) -> bool {
|
||||
// Atomically set the `LOCKED` bit. This is lowered to a single atomic instruction on most
|
||||
// modern processors (e.g. "lock bts" on x86 and "ldseta" on modern AArch64), and therefore
|
||||
// is more efficient than `fetch_update(lock(true))`, which can spuriously fail if a new
|
||||
// is more efficient than `try_update(lock(true))`, which can spuriously fail if a new
|
||||
// node is appended to the queue.
|
||||
self.state.fetch_or(LOCKED, Acquire).addr() & LOCKED == 0
|
||||
}
|
||||
|
|
@ -453,7 +453,7 @@ impl RwLock {
|
|||
|
||||
#[inline]
|
||||
pub unsafe fn read_unlock(&self) {
|
||||
match self.state.fetch_update(Release, Acquire, |state| {
|
||||
match self.state.try_update(Release, Acquire, |state| {
|
||||
if state.addr() & QUEUED == 0 {
|
||||
// If there are no threads queued, simply decrement the reader count.
|
||||
let count = state.addr() - (SINGLE | LOCKED);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#![allow(deprecated)]
|
||||
#![allow(dead_code)]
|
||||
#![feature(atomic_try_update)]
|
||||
|
||||
use std::sync::atomic::{AtomicBool, AtomicPtr, AtomicU32, Ordering};
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#![allow(deprecated)]
|
||||
#![allow(dead_code)]
|
||||
#![feature(atomic_try_update)]
|
||||
|
||||
use std::sync::atomic::{AtomicBool, AtomicPtr, AtomicU32, Ordering};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
warning: mutation of an interior mutable `const` item with call to `store`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:13:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:12:14
|
||||
|
|
||||
LL | let _a = A.store(true, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -17,7 +17,7 @@ LL + static A: AtomicBool = AtomicBool::new(false);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `swap`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:16:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:15:14
|
||||
|
|
||||
LL | let _a = A.swap(true, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -34,7 +34,7 @@ LL + static A: AtomicBool = AtomicBool::new(false);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `compare_and_swap`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:19:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:18:14
|
||||
|
|
||||
LL | let _a = A.compare_and_swap(false, true, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -51,7 +51,7 @@ LL + static A: AtomicBool = AtomicBool::new(false);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `compare_exchange`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:22:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:21:14
|
||||
|
|
||||
LL | let _a = A.compare_exchange(false, true, Ordering::SeqCst, Ordering::Relaxed);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -68,7 +68,7 @@ LL + static A: AtomicBool = AtomicBool::new(false);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `compare_exchange_weak`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:25:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:24:14
|
||||
|
|
||||
LL | let _a = A.compare_exchange_weak(false, true, Ordering::SeqCst, Ordering::Relaxed);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -85,7 +85,7 @@ LL + static A: AtomicBool = AtomicBool::new(false);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_and`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:28:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:27:14
|
||||
|
|
||||
LL | let _a = A.fetch_and(true, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -102,7 +102,7 @@ LL + static A: AtomicBool = AtomicBool::new(false);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_nand`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:31:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:30:14
|
||||
|
|
||||
LL | let _a = A.fetch_nand(true, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -119,7 +119,7 @@ LL + static A: AtomicBool = AtomicBool::new(false);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_or`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:34:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:33:14
|
||||
|
|
||||
LL | let _a = A.fetch_or(true, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -136,7 +136,7 @@ LL + static A: AtomicBool = AtomicBool::new(false);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_xor`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:37:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:36:14
|
||||
|
|
||||
LL | let _a = A.fetch_xor(true, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -153,7 +153,7 @@ LL + static A: AtomicBool = AtomicBool::new(false);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_not`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:40:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:39:14
|
||||
|
|
||||
LL | let _a = A.fetch_not(Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -170,7 +170,7 @@ LL + static A: AtomicBool = AtomicBool::new(false);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_update`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:43:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:42:14
|
||||
|
|
||||
LL | let _a = A.fetch_update(Ordering::SeqCst, Ordering::Relaxed, |_| Some(true));
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -187,7 +187,7 @@ LL + static A: AtomicBool = AtomicBool::new(false);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `try_update`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:46:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:45:14
|
||||
|
|
||||
LL | let _a = A.try_update(Ordering::SeqCst, Ordering::Relaxed, |_| Some(false));
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -204,7 +204,7 @@ LL + static A: AtomicBool = AtomicBool::new(false);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `update`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:49:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:48:14
|
||||
|
|
||||
LL | let _a = A.update(Ordering::SeqCst, Ordering::Relaxed, |_| true);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -221,7 +221,7 @@ LL + static A: AtomicBool = AtomicBool::new(false);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `store`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:56:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:55:14
|
||||
|
|
||||
LL | let _a = A.store(std::ptr::null_mut(), Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -238,7 +238,7 @@ LL + static A: AtomicPtr<i32> = AtomicPtr::new(std::ptr::null_mut());
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `swap`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:59:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:58:14
|
||||
|
|
||||
LL | let _a = A.swap(std::ptr::null_mut(), Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -255,7 +255,7 @@ LL + static A: AtomicPtr<i32> = AtomicPtr::new(std::ptr::null_mut());
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `compare_and_swap`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:62:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:61:14
|
||||
|
|
||||
LL | let _a = A.compare_and_swap(std::ptr::null_mut(), std::ptr::null_mut(), Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -272,7 +272,7 @@ LL + static A: AtomicPtr<i32> = AtomicPtr::new(std::ptr::null_mut());
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `compare_exchange`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:65:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:64:14
|
||||
|
|
||||
LL | let _a = A.compare_exchange(
|
||||
| ^ `A` is a interior mutable `const` item of type `AtomicPtr<i32>`
|
||||
|
|
@ -296,7 +296,7 @@ LL + static A: AtomicPtr<i32> = AtomicPtr::new(std::ptr::null_mut());
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `compare_exchange_weak`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:73:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:72:14
|
||||
|
|
||||
LL | let _a = A.compare_exchange_weak(
|
||||
| ^ `A` is a interior mutable `const` item of type `AtomicPtr<i32>`
|
||||
|
|
@ -320,7 +320,7 @@ LL + static A: AtomicPtr<i32> = AtomicPtr::new(std::ptr::null_mut());
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_update`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:81:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:80:14
|
||||
|
|
||||
LL | let _a = A.fetch_update(Ordering::SeqCst, Ordering::Relaxed, |_| Some(std::ptr::null_mut()));
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -337,7 +337,7 @@ LL + static A: AtomicPtr<i32> = AtomicPtr::new(std::ptr::null_mut());
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `try_update`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:84:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:83:14
|
||||
|
|
||||
LL | let _a = A.try_update(Ordering::SeqCst, Ordering::Relaxed, |_| Some(std::ptr::null_mut()));
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -354,7 +354,7 @@ LL + static A: AtomicPtr<i32> = AtomicPtr::new(std::ptr::null_mut());
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `update`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:87:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:86:14
|
||||
|
|
||||
LL | let _a = A.update(Ordering::SeqCst, Ordering::Relaxed, |_| std::ptr::null_mut());
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -371,7 +371,7 @@ LL + static A: AtomicPtr<i32> = AtomicPtr::new(std::ptr::null_mut());
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_ptr_add`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:90:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:89:14
|
||||
|
|
||||
LL | let _a = A.fetch_ptr_add(1, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -388,7 +388,7 @@ LL + static A: AtomicPtr<i32> = AtomicPtr::new(std::ptr::null_mut());
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_ptr_sub`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:93:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:92:14
|
||||
|
|
||||
LL | let _a = A.fetch_ptr_sub(1, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -405,7 +405,7 @@ LL + static A: AtomicPtr<i32> = AtomicPtr::new(std::ptr::null_mut());
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_byte_add`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:96:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:95:14
|
||||
|
|
||||
LL | let _a = A.fetch_byte_add(1, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -422,7 +422,7 @@ LL + static A: AtomicPtr<i32> = AtomicPtr::new(std::ptr::null_mut());
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_byte_sub`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:99:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:98:14
|
||||
|
|
||||
LL | let _a = A.fetch_byte_sub(1, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -439,7 +439,7 @@ LL + static A: AtomicPtr<i32> = AtomicPtr::new(std::ptr::null_mut());
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_and`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:102:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:101:14
|
||||
|
|
||||
LL | let _a = A.fetch_and(1, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -456,7 +456,7 @@ LL + static A: AtomicPtr<i32> = AtomicPtr::new(std::ptr::null_mut());
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_or`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:105:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:104:14
|
||||
|
|
||||
LL | let _a = A.fetch_or(1, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -473,7 +473,7 @@ LL + static A: AtomicPtr<i32> = AtomicPtr::new(std::ptr::null_mut());
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_xor`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:108:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:107:14
|
||||
|
|
||||
LL | let _a = A.fetch_xor(1, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -490,7 +490,7 @@ LL + static A: AtomicPtr<i32> = AtomicPtr::new(std::ptr::null_mut());
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `store`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:115:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:114:14
|
||||
|
|
||||
LL | let _a = A.store(1, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -507,7 +507,7 @@ LL + static A: AtomicU32 = AtomicU32::new(0);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `swap`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:118:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:117:14
|
||||
|
|
||||
LL | let _a = A.swap(2, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -524,7 +524,7 @@ LL + static A: AtomicU32 = AtomicU32::new(0);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `compare_and_swap`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:121:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:120:14
|
||||
|
|
||||
LL | let _a = A.compare_and_swap(2, 3, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -541,7 +541,7 @@ LL + static A: AtomicU32 = AtomicU32::new(0);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `compare_exchange`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:124:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:123:14
|
||||
|
|
||||
LL | let _a = A.compare_exchange(3, 4, Ordering::SeqCst, Ordering::Relaxed);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -558,7 +558,7 @@ LL + static A: AtomicU32 = AtomicU32::new(0);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `compare_exchange_weak`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:127:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:126:14
|
||||
|
|
||||
LL | let _a = A.compare_exchange_weak(4, 5, Ordering::SeqCst, Ordering::Relaxed);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -575,7 +575,7 @@ LL + static A: AtomicU32 = AtomicU32::new(0);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_add`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:130:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:129:14
|
||||
|
|
||||
LL | let _a = A.fetch_add(1, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -592,7 +592,7 @@ LL + static A: AtomicU32 = AtomicU32::new(0);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_sub`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:133:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:132:14
|
||||
|
|
||||
LL | let _a = A.fetch_sub(1, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -609,7 +609,7 @@ LL + static A: AtomicU32 = AtomicU32::new(0);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_add`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:136:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:135:14
|
||||
|
|
||||
LL | let _a = A.fetch_add(2, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -626,7 +626,7 @@ LL + static A: AtomicU32 = AtomicU32::new(0);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_nand`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:139:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:138:14
|
||||
|
|
||||
LL | let _a = A.fetch_nand(1, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -643,7 +643,7 @@ LL + static A: AtomicU32 = AtomicU32::new(0);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_or`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:142:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:141:14
|
||||
|
|
||||
LL | let _a = A.fetch_or(1, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -660,7 +660,7 @@ LL + static A: AtomicU32 = AtomicU32::new(0);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_xor`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:145:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:144:14
|
||||
|
|
||||
LL | let _a = A.fetch_xor(1, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -677,7 +677,7 @@ LL + static A: AtomicU32 = AtomicU32::new(0);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_update`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:148:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:147:14
|
||||
|
|
||||
LL | let _a = A.fetch_update(Ordering::SeqCst, Ordering::Relaxed, |_| Some(10));
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -694,7 +694,7 @@ LL + static A: AtomicU32 = AtomicU32::new(0);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `try_update`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:151:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:150:14
|
||||
|
|
||||
LL | let _a = A.try_update(Ordering::SeqCst, Ordering::Relaxed, |_| Some(11));
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -711,7 +711,7 @@ LL + static A: AtomicU32 = AtomicU32::new(0);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `update`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:154:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:153:14
|
||||
|
|
||||
LL | let _a = A.update(Ordering::SeqCst, Ordering::Relaxed, |_| 12);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -728,7 +728,7 @@ LL + static A: AtomicU32 = AtomicU32::new(0);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_max`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:157:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:156:14
|
||||
|
|
||||
LL | let _a = A.fetch_max(20, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -745,7 +745,7 @@ LL + static A: AtomicU32 = AtomicU32::new(0);
|
|||
|
|
||||
|
||||
warning: mutation of an interior mutable `const` item with call to `fetch_min`
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:160:14
|
||||
--> $DIR/const-item-interior-mutations-const-atomics.rs:159:14
|
||||
|
|
||||
LL | let _a = A.fetch_min(5, Ordering::SeqCst);
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
//@ only-x86_64
|
||||
#![feature(atomic_try_update)]
|
||||
|
||||
use std::sync::atomic::{AtomicIsize, Ordering};
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:73:47
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:71:47
|
||||
|
|
||||
LL | let _ = x.fetch_update(Ordering::Relaxed, Ordering::AcqRel, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -8,7 +8,7 @@ LL | let _ = x.fetch_update(Ordering::Relaxed, Ordering::AcqRel, |old| Some(
|
|||
= note: `#[deny(invalid_atomic_ordering)]` on by default
|
||||
|
||||
error: `try_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `try_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:75:45
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:73:45
|
||||
|
|
||||
LL | let _ = x.try_update(Ordering::Relaxed, Ordering::AcqRel, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -16,7 +16,7 @@ LL | let _ = x.try_update(Ordering::Relaxed, Ordering::AcqRel, |old| Some(ol
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:77:41
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:75:41
|
||||
|
|
||||
LL | let _ = x.update(Ordering::Relaxed, Ordering::AcqRel, |old| old + 1);
|
||||
| ^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -24,7 +24,7 @@ LL | let _ = x.update(Ordering::Relaxed, Ordering::AcqRel, |old| old + 1);
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:80:47
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:78:47
|
||||
|
|
||||
LL | let _ = x.fetch_update(Ordering::Acquire, Ordering::AcqRel, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -32,7 +32,7 @@ LL | let _ = x.fetch_update(Ordering::Acquire, Ordering::AcqRel, |old| Some(
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `try_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `try_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:82:45
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:80:45
|
||||
|
|
||||
LL | let _ = x.try_update(Ordering::Acquire, Ordering::AcqRel, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -40,7 +40,7 @@ LL | let _ = x.try_update(Ordering::Acquire, Ordering::AcqRel, |old| Some(ol
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:84:41
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:82:41
|
||||
|
|
||||
LL | let _ = x.update(Ordering::Acquire, Ordering::AcqRel, |old| old + 1);
|
||||
| ^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -48,7 +48,7 @@ LL | let _ = x.update(Ordering::Acquire, Ordering::AcqRel, |old| old + 1);
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:87:47
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:85:47
|
||||
|
|
||||
LL | let _ = x.fetch_update(Ordering::Release, Ordering::AcqRel, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -56,7 +56,7 @@ LL | let _ = x.fetch_update(Ordering::Release, Ordering::AcqRel, |old| Some(
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `try_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `try_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:89:45
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:87:45
|
||||
|
|
||||
LL | let _ = x.try_update(Ordering::Release, Ordering::AcqRel, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -64,7 +64,7 @@ LL | let _ = x.try_update(Ordering::Release, Ordering::AcqRel, |old| Some(ol
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:91:41
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:89:41
|
||||
|
|
||||
LL | let _ = x.update(Ordering::Release, Ordering::AcqRel, |old| old + 1);
|
||||
| ^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -72,7 +72,7 @@ LL | let _ = x.update(Ordering::Release, Ordering::AcqRel, |old| old + 1);
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:94:46
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:92:46
|
||||
|
|
||||
LL | let _ = x.fetch_update(Ordering::AcqRel, Ordering::AcqRel, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -80,7 +80,7 @@ LL | let _ = x.fetch_update(Ordering::AcqRel, Ordering::AcqRel, |old| Some(o
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `try_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `try_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:96:44
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:94:44
|
||||
|
|
||||
LL | let _ = x.try_update(Ordering::AcqRel, Ordering::AcqRel, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -88,7 +88,7 @@ LL | let _ = x.try_update(Ordering::AcqRel, Ordering::AcqRel, |old| Some(old
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:98:40
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:96:40
|
||||
|
|
||||
LL | let _ = x.update(Ordering::AcqRel, Ordering::AcqRel, |old| old + 1);
|
||||
| ^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -96,7 +96,7 @@ LL | let _ = x.update(Ordering::AcqRel, Ordering::AcqRel, |old| old + 1);
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:101:46
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:99:46
|
||||
|
|
||||
LL | let _ = x.fetch_update(Ordering::SeqCst, Ordering::AcqRel, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -104,7 +104,7 @@ LL | let _ = x.fetch_update(Ordering::SeqCst, Ordering::AcqRel, |old| Some(o
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `try_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `try_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:103:44
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:101:44
|
||||
|
|
||||
LL | let _ = x.try_update(Ordering::SeqCst, Ordering::AcqRel, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -112,7 +112,7 @@ LL | let _ = x.try_update(Ordering::SeqCst, Ordering::AcqRel, |old| Some(old
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:105:40
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:103:40
|
||||
|
|
||||
LL | let _ = x.update(Ordering::SeqCst, Ordering::AcqRel, |old| old + 1);
|
||||
| ^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -120,7 +120,7 @@ LL | let _ = x.update(Ordering::SeqCst, Ordering::AcqRel, |old| old + 1);
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:110:47
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:108:47
|
||||
|
|
||||
LL | let _ = x.fetch_update(Ordering::Relaxed, Ordering::Release, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -128,7 +128,7 @@ LL | let _ = x.fetch_update(Ordering::Relaxed, Ordering::Release, |old| Some
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `try_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `try_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:112:45
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:110:45
|
||||
|
|
||||
LL | let _ = x.try_update(Ordering::Relaxed, Ordering::Release, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -136,7 +136,7 @@ LL | let _ = x.try_update(Ordering::Relaxed, Ordering::Release, |old| Some(o
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:114:41
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:112:41
|
||||
|
|
||||
LL | let _ = x.update(Ordering::Relaxed, Ordering::Release, |old| old + 1);
|
||||
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -144,7 +144,7 @@ LL | let _ = x.update(Ordering::Relaxed, Ordering::Release, |old| old + 1);
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:117:47
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:115:47
|
||||
|
|
||||
LL | let _ = x.fetch_update(Ordering::Acquire, Ordering::Release, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -152,7 +152,7 @@ LL | let _ = x.fetch_update(Ordering::Acquire, Ordering::Release, |old| Some
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `try_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `try_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:119:45
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:117:45
|
||||
|
|
||||
LL | let _ = x.try_update(Ordering::Acquire, Ordering::Release, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -160,7 +160,7 @@ LL | let _ = x.try_update(Ordering::Acquire, Ordering::Release, |old| Some(o
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:121:41
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:119:41
|
||||
|
|
||||
LL | let _ = x.update(Ordering::Acquire, Ordering::Release, |old| old + 1);
|
||||
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -168,7 +168,7 @@ LL | let _ = x.update(Ordering::Acquire, Ordering::Release, |old| old + 1);
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:124:47
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:122:47
|
||||
|
|
||||
LL | let _ = x.fetch_update(Ordering::Release, Ordering::Release, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -176,7 +176,7 @@ LL | let _ = x.fetch_update(Ordering::Release, Ordering::Release, |old| Some
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `try_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `try_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:126:45
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:124:45
|
||||
|
|
||||
LL | let _ = x.try_update(Ordering::Release, Ordering::Release, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -184,7 +184,7 @@ LL | let _ = x.try_update(Ordering::Release, Ordering::Release, |old| Some(o
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:128:41
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:126:41
|
||||
|
|
||||
LL | let _ = x.update(Ordering::Release, Ordering::Release, |old| old + 1);
|
||||
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -192,7 +192,7 @@ LL | let _ = x.update(Ordering::Release, Ordering::Release, |old| old + 1);
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:131:46
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:129:46
|
||||
|
|
||||
LL | let _ = x.fetch_update(Ordering::AcqRel, Ordering::Release, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -200,7 +200,7 @@ LL | let _ = x.fetch_update(Ordering::AcqRel, Ordering::Release, |old| Some(
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `try_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `try_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:133:44
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:131:44
|
||||
|
|
||||
LL | let _ = x.try_update(Ordering::AcqRel, Ordering::Release, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -208,7 +208,7 @@ LL | let _ = x.try_update(Ordering::AcqRel, Ordering::Release, |old| Some(ol
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:135:40
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:133:40
|
||||
|
|
||||
LL | let _ = x.update(Ordering::AcqRel, Ordering::Release, |old| old + 1);
|
||||
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -216,7 +216,7 @@ LL | let _ = x.update(Ordering::AcqRel, Ordering::Release, |old| old + 1);
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:138:46
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:136:46
|
||||
|
|
||||
LL | let _ = x.fetch_update(Ordering::SeqCst, Ordering::Release, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -224,7 +224,7 @@ LL | let _ = x.fetch_update(Ordering::SeqCst, Ordering::Release, |old| Some(
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `try_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `try_update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:140:44
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:138:44
|
||||
|
|
||||
LL | let _ = x.try_update(Ordering::SeqCst, Ordering::Release, |old| Some(old + 1));
|
||||
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
@ -232,7 +232,7 @@ LL | let _ = x.try_update(Ordering::SeqCst, Ordering::Release, |old| Some(ol
|
|||
= help: consider using `Acquire` or `Relaxed` failure ordering instead
|
||||
|
||||
error: `update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `update` does not result in a write
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:142:40
|
||||
--> $DIR/lint-invalid-atomic-ordering-update.rs:140:40
|
||||
|
|
||||
LL | let _ = x.update(Ordering::SeqCst, Ordering::Release, |old| old + 1);
|
||||
| ^^^^^^^^^^^^^^^^^ invalid failure ordering
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue