Skip to content

Commit

Permalink
Use upgrade_success_ordering on Miri
Browse files Browse the repository at this point in the history
rust-lang/miri#2382 has not been released yet.
  • Loading branch information
taiki-e committed Jul 23, 2022
1 parent 8a8d55b commit f35d725
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/imp/core_atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl AtomicBool {
success: Ordering,
failure: Ordering,
) -> Result<bool, bool> {
#[cfg(not(portable_atomic_core_stronger_failure_ordering))]
#[cfg(any(not(portable_atomic_core_stronger_failure_ordering), miri))]
let success = crate::utils::upgrade_success_ordering(success, failure);
self.inner.compare_exchange(current, new, success, failure)
}
Expand All @@ -52,7 +52,7 @@ impl AtomicBool {
success: Ordering,
failure: Ordering,
) -> Result<bool, bool> {
#[cfg(not(portable_atomic_core_stronger_failure_ordering))]
#[cfg(any(not(portable_atomic_core_stronger_failure_ordering), miri))]
let success = crate::utils::upgrade_success_ordering(success, failure);
self.inner.compare_exchange_weak(current, new, success, failure)
}
Expand Down Expand Up @@ -102,7 +102,7 @@ impl<T> AtomicPtr<T> {
success: Ordering,
failure: Ordering,
) -> Result<*mut T, *mut T> {
#[cfg(not(portable_atomic_core_stronger_failure_ordering))]
#[cfg(any(not(portable_atomic_core_stronger_failure_ordering), miri))]
let success = crate::utils::upgrade_success_ordering(success, failure);
self.inner.compare_exchange(current, new, success, failure)
}
Expand All @@ -116,7 +116,7 @@ impl<T> AtomicPtr<T> {
success: Ordering,
failure: Ordering,
) -> Result<*mut T, *mut T> {
#[cfg(not(portable_atomic_core_stronger_failure_ordering))]
#[cfg(any(not(portable_atomic_core_stronger_failure_ordering), miri))]
let success = crate::utils::upgrade_success_ordering(success, failure);
self.inner.compare_exchange_weak(current, new, success, failure)
}
Expand Down Expand Up @@ -174,7 +174,7 @@ macro_rules! atomic_int {
success: Ordering,
failure: Ordering,
) -> Result<$int_type, $int_type> {
#[cfg(not(portable_atomic_core_stronger_failure_ordering))]
#[cfg(any(not(portable_atomic_core_stronger_failure_ordering), miri))]
let success = crate::utils::upgrade_success_ordering(success, failure);
self.inner.compare_exchange(current, new, success, failure)
}
Expand All @@ -194,7 +194,7 @@ macro_rules! atomic_int {
success: Ordering,
failure: Ordering,
) -> Result<$int_type, $int_type> {
#[cfg(not(portable_atomic_core_stronger_failure_ordering))]
#[cfg(any(not(portable_atomic_core_stronger_failure_ordering), miri))]
let success = crate::utils::upgrade_success_ordering(success, failure);
self.inner.compare_exchange_weak(current, new, success, failure)
}
Expand Down

0 comments on commit f35d725

Please sign in to comment.