@@ -371,6 +371,7 @@ impl AtomicBool {
371371/// ``` 
372372#[ inline]  
373373    #[ stable( feature = "rust1" ,  since = "1.0.0" ) ]  
374+     #[ cfg( any( stage0,  target_has_atomic = "cas" ) ) ]  
374375    pub  fn  swap ( & self ,  val :  bool ,  order :  Ordering )  -> bool  { 
375376        unsafe  {  atomic_swap ( self . v . get ( ) ,  val as  u8 ,  order)  != 0  } 
376377    } 
@@ -401,6 +402,7 @@ impl AtomicBool {
401402/// ``` 
402403#[ inline]  
403404    #[ stable( feature = "rust1" ,  since = "1.0.0" ) ]  
405+     #[ cfg( any( stage0,  target_has_atomic = "cas" ) ) ]  
404406    pub  fn  compare_and_swap ( & self ,  current :  bool ,  new :  bool ,  order :  Ordering )  -> bool  { 
405407        match  self . compare_exchange ( current,  new,  order,  strongest_failure_ordering ( order) )  { 
406408            Ok ( x)  => x, 
@@ -446,6 +448,7 @@ impl AtomicBool {
446448/// ``` 
447449#[ inline]  
448450    #[ stable( feature = "extended_compare_and_swap" ,  since = "1.10.0" ) ]  
451+     #[ cfg( any( stage0,  target_has_atomic = "cas" ) ) ]  
449452    pub  fn  compare_exchange ( & self , 
450453                            current :  bool , 
451454                            new :  bool , 
@@ -537,6 +540,7 @@ impl AtomicBool {
537540/// ``` 
538541#[ inline]  
539542    #[ stable( feature = "rust1" ,  since = "1.0.0" ) ]  
543+     #[ cfg( any( stage0,  target_has_atomic = "cas" ) ) ]  
540544    pub  fn  fetch_and ( & self ,  val :  bool ,  order :  Ordering )  -> bool  { 
541545        unsafe  {  atomic_and ( self . v . get ( ) ,  val as  u8 ,  order)  != 0  } 
542546    } 
@@ -568,6 +572,7 @@ impl AtomicBool {
568572/// ``` 
569573#[ inline]  
570574    #[ stable( feature = "rust1" ,  since = "1.0.0" ) ]  
575+     #[ cfg( any( stage0,  target_has_atomic = "cas" ) ) ]  
571576    pub  fn  fetch_nand ( & self ,  val :  bool ,  order :  Ordering )  -> bool  { 
572577        // We can't use atomic_nand here because it can result in a bool with 
573578        // an invalid value. This happens because the atomic operation is done 
@@ -610,6 +615,7 @@ impl AtomicBool {
610615/// ``` 
611616#[ inline]  
612617    #[ stable( feature = "rust1" ,  since = "1.0.0" ) ]  
618+     #[ cfg( any( stage0,  target_has_atomic = "cas" ) ) ]  
613619    pub  fn  fetch_or ( & self ,  val :  bool ,  order :  Ordering )  -> bool  { 
614620        unsafe  {  atomic_or ( self . v . get ( ) ,  val as  u8 ,  order)  != 0  } 
615621    } 
@@ -640,6 +646,7 @@ impl AtomicBool {
640646/// ``` 
641647#[ inline]  
642648    #[ stable( feature = "rust1" ,  since = "1.0.0" ) ]  
649+     #[ cfg( any( stage0,  target_has_atomic = "cas" ) ) ]  
643650    pub  fn  fetch_xor ( & self ,  val :  bool ,  order :  Ordering )  -> bool  { 
644651        unsafe  {  atomic_xor ( self . v . get ( ) ,  val as  u8 ,  order)  != 0  } 
645652    } 
@@ -786,6 +793,7 @@ impl<T> AtomicPtr<T> {
786793/// ``` 
787794#[ inline]  
788795    #[ stable( feature = "rust1" ,  since = "1.0.0" ) ]  
796+     #[ cfg( any( stage0,  target_has_atomic = "cas" ) ) ]  
789797    pub  fn  swap ( & self ,  ptr :  * mut  T ,  order :  Ordering )  -> * mut  T  { 
790798        unsafe  {  atomic_swap ( self . p . get ( )  as  * mut  usize ,  ptr as  usize ,  order)  as  * mut  T  } 
791799    } 
@@ -815,6 +823,7 @@ impl<T> AtomicPtr<T> {
815823/// ``` 
816824#[ inline]  
817825    #[ stable( feature = "rust1" ,  since = "1.0.0" ) ]  
826+     #[ cfg( any( stage0,  target_has_atomic = "cas" ) ) ]  
818827    pub  fn  compare_and_swap ( & self ,  current :  * mut  T ,  new :  * mut  T ,  order :  Ordering )  -> * mut  T  { 
819828        match  self . compare_exchange ( current,  new,  order,  strongest_failure_ordering ( order) )  { 
820829            Ok ( x)  => x, 
@@ -853,6 +862,7 @@ impl<T> AtomicPtr<T> {
853862/// ``` 
854863#[ inline]  
855864    #[ stable( feature = "extended_compare_and_swap" ,  since = "1.10.0" ) ]  
865+     #[ cfg( any( stage0,  target_has_atomic = "cas" ) ) ]  
856866    pub  fn  compare_exchange ( & self , 
857867                            current :  * mut  T , 
858868                            new :  * mut  T , 
@@ -1138,6 +1148,7 @@ assert_eq!(some_var.swap(10, Ordering::Relaxed), 5);
11381148```" ) , 
11391149                #[ inline] 
11401150                #[ $stable] 
1151+                 #[ cfg( any( stage0,  target_has_atomic = "cas" ) ) ] 
11411152                pub  fn  swap( & self ,  val:  $int_type,  order:  Ordering )  -> $int_type { 
11421153                    unsafe  {  atomic_swap( self . v. get( ) ,  val,  order)  } 
11431154                } 
@@ -1170,6 +1181,7 @@ assert_eq!(some_var.load(Ordering::Relaxed), 10);
11701181```" ) , 
11711182                #[ inline] 
11721183                #[ $stable] 
1184+                 #[ cfg( any( stage0,  target_has_atomic = "cas" ) ) ] 
11731185                pub  fn  compare_and_swap( & self , 
11741186                                        current:  $int_type, 
11751187                                        new:  $int_type, 
@@ -1223,6 +1235,7 @@ assert_eq!(some_var.load(Ordering::Relaxed), 10);
12231235```" ) , 
12241236                #[ inline] 
12251237                #[ $stable_cxchg] 
1238+                 #[ cfg( any( stage0,  target_has_atomic = "cas" ) ) ] 
12261239                pub  fn  compare_exchange( & self , 
12271240                                        current:  $int_type, 
12281241                                        new:  $int_type, 
@@ -1677,6 +1690,7 @@ atomic_int!{
16771690} 
16781691
16791692#[ inline]  
1693+ #[ cfg( any( stage0,  target_has_atomic = "cas" ) ) ]  
16801694fn  strongest_failure_ordering ( order :  Ordering )  -> Ordering  { 
16811695    match  order { 
16821696        Release  => Relaxed , 
@@ -1713,6 +1727,7 @@ unsafe fn atomic_load<T>(dst: *const T, order: Ordering) -> T {
17131727} 
17141728
17151729#[ inline]  
1730+ #[ cfg( any( stage0,  target_has_atomic = "cas" ) ) ]  
17161731unsafe  fn  atomic_swap < T > ( dst :  * mut  T ,  val :  T ,  order :  Ordering )  -> T  { 
17171732    match  order { 
17181733        Acquire  => intrinsics:: atomic_xchg_acq ( dst,  val) , 
@@ -1751,6 +1766,7 @@ unsafe fn atomic_sub<T>(dst: *mut T, val: T, order: Ordering) -> T {
17511766} 
17521767
17531768#[ inline]  
1769+ #[ cfg( any( stage0,  target_has_atomic = "cas" ) ) ]  
17541770unsafe  fn  atomic_compare_exchange < T > ( dst :  * mut  T , 
17551771                                     old :  T , 
17561772                                     new :  T , 
0 commit comments