@@ -371,7 +371,7 @@ impl AtomicBool {
371
371
/// ```
372
372
#[ inline]
373
373
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
374
- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
374
+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
375
375
pub fn swap ( & self , val : bool , order : Ordering ) -> bool {
376
376
unsafe { atomic_swap ( self . v . get ( ) , val as u8 , order) != 0 }
377
377
}
@@ -402,7 +402,7 @@ impl AtomicBool {
402
402
/// ```
403
403
#[ inline]
404
404
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
405
- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
405
+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
406
406
pub fn compare_and_swap ( & self , current : bool , new : bool , order : Ordering ) -> bool {
407
407
match self . compare_exchange ( current, new, order, strongest_failure_ordering ( order) ) {
408
408
Ok ( x) => x,
@@ -448,7 +448,7 @@ impl AtomicBool {
448
448
/// ```
449
449
#[ inline]
450
450
#[ stable( feature = "extended_compare_and_swap" , since = "1.10.0" ) ]
451
- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
451
+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
452
452
pub fn compare_exchange ( & self ,
453
453
current : bool ,
454
454
new : bool ,
@@ -540,7 +540,7 @@ impl AtomicBool {
540
540
/// ```
541
541
#[ inline]
542
542
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
543
- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
543
+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
544
544
pub fn fetch_and ( & self , val : bool , order : Ordering ) -> bool {
545
545
unsafe { atomic_and ( self . v . get ( ) , val as u8 , order) != 0 }
546
546
}
@@ -572,7 +572,7 @@ impl AtomicBool {
572
572
/// ```
573
573
#[ inline]
574
574
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
575
- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
575
+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
576
576
pub fn fetch_nand ( & self , val : bool , order : Ordering ) -> bool {
577
577
// We can't use atomic_nand here because it can result in a bool with
578
578
// an invalid value. This happens because the atomic operation is done
@@ -615,7 +615,7 @@ impl AtomicBool {
615
615
/// ```
616
616
#[ inline]
617
617
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
618
- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
618
+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
619
619
pub fn fetch_or ( & self , val : bool , order : Ordering ) -> bool {
620
620
unsafe { atomic_or ( self . v . get ( ) , val as u8 , order) != 0 }
621
621
}
@@ -646,7 +646,7 @@ impl AtomicBool {
646
646
/// ```
647
647
#[ inline]
648
648
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
649
- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
649
+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
650
650
pub fn fetch_xor ( & self , val : bool , order : Ordering ) -> bool {
651
651
unsafe { atomic_xor ( self . v . get ( ) , val as u8 , order) != 0 }
652
652
}
@@ -793,7 +793,7 @@ impl<T> AtomicPtr<T> {
793
793
/// ```
794
794
#[ inline]
795
795
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
796
- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
796
+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
797
797
pub fn swap ( & self , ptr : * mut T , order : Ordering ) -> * mut T {
798
798
unsafe { atomic_swap ( self . p . get ( ) as * mut usize , ptr as usize , order) as * mut T }
799
799
}
@@ -823,7 +823,7 @@ impl<T> AtomicPtr<T> {
823
823
/// ```
824
824
#[ inline]
825
825
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
826
- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
826
+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
827
827
pub fn compare_and_swap ( & self , current : * mut T , new : * mut T , order : Ordering ) -> * mut T {
828
828
match self . compare_exchange ( current, new, order, strongest_failure_ordering ( order) ) {
829
829
Ok ( x) => x,
@@ -862,7 +862,7 @@ impl<T> AtomicPtr<T> {
862
862
/// ```
863
863
#[ inline]
864
864
#[ stable( feature = "extended_compare_and_swap" , since = "1.10.0" ) ]
865
- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
865
+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
866
866
pub fn compare_exchange ( & self ,
867
867
current : * mut T ,
868
868
new : * mut T ,
@@ -1148,7 +1148,7 @@ assert_eq!(some_var.swap(10, Ordering::Relaxed), 5);
1148
1148
```" ) ,
1149
1149
#[ inline]
1150
1150
#[ $stable]
1151
- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
1151
+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
1152
1152
pub fn swap( & self , val: $int_type, order: Ordering ) -> $int_type {
1153
1153
unsafe { atomic_swap( self . v. get( ) , val, order) }
1154
1154
}
@@ -1181,7 +1181,7 @@ assert_eq!(some_var.load(Ordering::Relaxed), 10);
1181
1181
```" ) ,
1182
1182
#[ inline]
1183
1183
#[ $stable]
1184
- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
1184
+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
1185
1185
pub fn compare_and_swap( & self ,
1186
1186
current: $int_type,
1187
1187
new: $int_type,
@@ -1235,7 +1235,7 @@ assert_eq!(some_var.load(Ordering::Relaxed), 10);
1235
1235
```" ) ,
1236
1236
#[ inline]
1237
1237
#[ $stable_cxchg]
1238
- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
1238
+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
1239
1239
pub fn compare_exchange( & self ,
1240
1240
current: $int_type,
1241
1241
new: $int_type,
@@ -1690,7 +1690,7 @@ atomic_int!{
1690
1690
}
1691
1691
1692
1692
#[ inline]
1693
- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
1693
+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
1694
1694
fn strongest_failure_ordering ( order : Ordering ) -> Ordering {
1695
1695
match order {
1696
1696
Release => Relaxed ,
@@ -1727,7 +1727,7 @@ unsafe fn atomic_load<T>(dst: *const T, order: Ordering) -> T {
1727
1727
}
1728
1728
1729
1729
#[ inline]
1730
- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
1730
+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
1731
1731
unsafe fn atomic_swap < T > ( dst : * mut T , val : T , order : Ordering ) -> T {
1732
1732
match order {
1733
1733
Acquire => intrinsics:: atomic_xchg_acq ( dst, val) ,
@@ -1766,7 +1766,7 @@ unsafe fn atomic_sub<T>(dst: *mut T, val: T, order: Ordering) -> T {
1766
1766
}
1767
1767
1768
1768
#[ inline]
1769
- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
1769
+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
1770
1770
unsafe fn atomic_compare_exchange < T > ( dst : * mut T ,
1771
1771
old : T ,
1772
1772
new : T ,
0 commit comments