@@ -371,7 +371,7 @@ impl AtomicBool {
371371 /// ```
372372 #[ inline]
373373 #[ 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" ) ) ]
375375 pub fn swap ( & self , val : bool , order : Ordering ) -> bool {
376376 unsafe { atomic_swap ( self . v . get ( ) , val as u8 , order) != 0 }
377377 }
@@ -402,7 +402,7 @@ impl AtomicBool {
402402 /// ```
403403 #[ inline]
404404 #[ 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" ) ) ]
406406 pub fn compare_and_swap ( & self , current : bool , new : bool , order : Ordering ) -> bool {
407407 match self . compare_exchange ( current, new, order, strongest_failure_ordering ( order) ) {
408408 Ok ( x) => x,
@@ -448,7 +448,7 @@ impl AtomicBool {
448448 /// ```
449449 #[ inline]
450450 #[ 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" ) ) ]
452452 pub fn compare_exchange ( & self ,
453453 current : bool ,
454454 new : bool ,
@@ -540,7 +540,7 @@ impl AtomicBool {
540540 /// ```
541541 #[ inline]
542542 #[ 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" ) ) ]
544544 pub fn fetch_and ( & self , val : bool , order : Ordering ) -> bool {
545545 unsafe { atomic_and ( self . v . get ( ) , val as u8 , order) != 0 }
546546 }
@@ -572,7 +572,7 @@ impl AtomicBool {
572572 /// ```
573573 #[ inline]
574574 #[ 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" ) ) ]
576576 pub fn fetch_nand ( & self , val : bool , order : Ordering ) -> bool {
577577 // We can't use atomic_nand here because it can result in a bool with
578578 // an invalid value. This happens because the atomic operation is done
@@ -615,7 +615,7 @@ impl AtomicBool {
615615 /// ```
616616 #[ inline]
617617 #[ 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" ) ) ]
619619 pub fn fetch_or ( & self , val : bool , order : Ordering ) -> bool {
620620 unsafe { atomic_or ( self . v . get ( ) , val as u8 , order) != 0 }
621621 }
@@ -646,7 +646,7 @@ impl AtomicBool {
646646 /// ```
647647 #[ inline]
648648 #[ 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" ) ) ]
650650 pub fn fetch_xor ( & self , val : bool , order : Ordering ) -> bool {
651651 unsafe { atomic_xor ( self . v . get ( ) , val as u8 , order) != 0 }
652652 }
@@ -793,7 +793,7 @@ impl<T> AtomicPtr<T> {
793793 /// ```
794794 #[ inline]
795795 #[ 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" ) ) ]
797797 pub fn swap ( & self , ptr : * mut T , order : Ordering ) -> * mut T {
798798 unsafe { atomic_swap ( self . p . get ( ) as * mut usize , ptr as usize , order) as * mut T }
799799 }
@@ -823,7 +823,7 @@ impl<T> AtomicPtr<T> {
823823 /// ```
824824 #[ inline]
825825 #[ 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" ) ) ]
827827 pub fn compare_and_swap ( & self , current : * mut T , new : * mut T , order : Ordering ) -> * mut T {
828828 match self . compare_exchange ( current, new, order, strongest_failure_ordering ( order) ) {
829829 Ok ( x) => x,
@@ -862,7 +862,7 @@ impl<T> AtomicPtr<T> {
862862 /// ```
863863 #[ inline]
864864 #[ 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" ) ) ]
866866 pub fn compare_exchange ( & self ,
867867 current : * mut T ,
868868 new : * mut T ,
@@ -1148,7 +1148,7 @@ assert_eq!(some_var.swap(10, Ordering::Relaxed), 5);
11481148```" ) ,
11491149 #[ inline]
11501150 #[ $stable]
1151- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
1151+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
11521152 pub fn swap( & self , val: $int_type, order: Ordering ) -> $int_type {
11531153 unsafe { atomic_swap( self . v. get( ) , val, order) }
11541154 }
@@ -1181,7 +1181,7 @@ assert_eq!(some_var.load(Ordering::Relaxed), 10);
11811181```" ) ,
11821182 #[ inline]
11831183 #[ $stable]
1184- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
1184+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
11851185 pub fn compare_and_swap( & self ,
11861186 current: $int_type,
11871187 new: $int_type,
@@ -1235,7 +1235,7 @@ assert_eq!(some_var.load(Ordering::Relaxed), 10);
12351235```" ) ,
12361236 #[ inline]
12371237 #[ $stable_cxchg]
1238- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
1238+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
12391239 pub fn compare_exchange( & self ,
12401240 current: $int_type,
12411241 new: $int_type,
@@ -1690,7 +1690,7 @@ atomic_int!{
16901690}
16911691
16921692#[ inline]
1693- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
1693+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
16941694fn strongest_failure_ordering ( order : Ordering ) -> Ordering {
16951695 match order {
16961696 Release => Relaxed ,
@@ -1727,7 +1727,7 @@ unsafe fn atomic_load<T>(dst: *const T, order: Ordering) -> T {
17271727}
17281728
17291729#[ inline]
1730- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
1730+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
17311731unsafe fn atomic_swap < T > ( dst : * mut T , val : T , order : Ordering ) -> T {
17321732 match order {
17331733 Acquire => intrinsics:: atomic_xchg_acq ( dst, val) ,
@@ -1766,7 +1766,7 @@ unsafe fn atomic_sub<T>(dst: *mut T, val: T, order: Ordering) -> T {
17661766}
17671767
17681768#[ inline]
1769- #[ cfg_attr ( not ( stage0) , cfg ( target_has_atomic_cas ) ) ]
1769+ #[ cfg ( any ( stage0, target_has_atomic = "cas" ) ) ]
17701770unsafe fn atomic_compare_exchange < T > ( dst : * mut T ,
17711771 old : T ,
17721772 new : T ,
0 commit comments