Skip to content

Commit f35d725

Browse files
committed
Use upgrade_success_ordering on Miri
rust-lang/miri#2382 has not been released yet.
1 parent 8a8d55b commit f35d725

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/imp/core_atomic.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl AtomicBool {
3838
success: Ordering,
3939
failure: Ordering,
4040
) -> Result<bool, bool> {
41-
#[cfg(not(portable_atomic_core_stronger_failure_ordering))]
41+
#[cfg(any(not(portable_atomic_core_stronger_failure_ordering), miri))]
4242
let success = crate::utils::upgrade_success_ordering(success, failure);
4343
self.inner.compare_exchange(current, new, success, failure)
4444
}
@@ -52,7 +52,7 @@ impl AtomicBool {
5252
success: Ordering,
5353
failure: Ordering,
5454
) -> Result<bool, bool> {
55-
#[cfg(not(portable_atomic_core_stronger_failure_ordering))]
55+
#[cfg(any(not(portable_atomic_core_stronger_failure_ordering), miri))]
5656
let success = crate::utils::upgrade_success_ordering(success, failure);
5757
self.inner.compare_exchange_weak(current, new, success, failure)
5858
}
@@ -102,7 +102,7 @@ impl<T> AtomicPtr<T> {
102102
success: Ordering,
103103
failure: Ordering,
104104
) -> Result<*mut T, *mut T> {
105-
#[cfg(not(portable_atomic_core_stronger_failure_ordering))]
105+
#[cfg(any(not(portable_atomic_core_stronger_failure_ordering), miri))]
106106
let success = crate::utils::upgrade_success_ordering(success, failure);
107107
self.inner.compare_exchange(current, new, success, failure)
108108
}
@@ -116,7 +116,7 @@ impl<T> AtomicPtr<T> {
116116
success: Ordering,
117117
failure: Ordering,
118118
) -> Result<*mut T, *mut T> {
119-
#[cfg(not(portable_atomic_core_stronger_failure_ordering))]
119+
#[cfg(any(not(portable_atomic_core_stronger_failure_ordering), miri))]
120120
let success = crate::utils::upgrade_success_ordering(success, failure);
121121
self.inner.compare_exchange_weak(current, new, success, failure)
122122
}
@@ -174,7 +174,7 @@ macro_rules! atomic_int {
174174
success: Ordering,
175175
failure: Ordering,
176176
) -> Result<$int_type, $int_type> {
177-
#[cfg(not(portable_atomic_core_stronger_failure_ordering))]
177+
#[cfg(any(not(portable_atomic_core_stronger_failure_ordering), miri))]
178178
let success = crate::utils::upgrade_success_ordering(success, failure);
179179
self.inner.compare_exchange(current, new, success, failure)
180180
}
@@ -194,7 +194,7 @@ macro_rules! atomic_int {
194194
success: Ordering,
195195
failure: Ordering,
196196
) -> Result<$int_type, $int_type> {
197-
#[cfg(not(portable_atomic_core_stronger_failure_ordering))]
197+
#[cfg(any(not(portable_atomic_core_stronger_failure_ordering), miri))]
198198
let success = crate::utils::upgrade_success_ordering(success, failure);
199199
self.inner.compare_exchange_weak(current, new, success, failure)
200200
}

0 commit comments

Comments
 (0)