@@ -497,26 +497,19 @@ macro_rules! impl_arithmetic {
497497    } ; 
498498} 
499499
500- #[ cfg( has_atomic_u8) ]  
501500impl_arithmetic ! ( u8 ,  atomic:: AtomicU8 ,  "let a = AtomicCell::new(7u8);" ) ; 
502- #[ cfg( all( has_atomic_u8,  not( crossbeam_loom) ) ) ]  
503501impl_arithmetic ! ( i8 ,  atomic:: AtomicI8 ,  "let a = AtomicCell::new(7i8);" ) ; 
504- #[ cfg( has_atomic_u16) ]  
505502impl_arithmetic ! ( u16 ,  atomic:: AtomicU16 ,  "let a = AtomicCell::new(7u16);" ) ; 
506- #[ cfg( all( has_atomic_u16,  not( crossbeam_loom) ) ) ]  
507503impl_arithmetic ! ( i16 ,  atomic:: AtomicI16 ,  "let a = AtomicCell::new(7i16);" ) ; 
508- #[ cfg( has_atomic_u32) ]  
509504impl_arithmetic ! ( u32 ,  atomic:: AtomicU32 ,  "let a = AtomicCell::new(7u32);" ) ; 
510- #[ cfg( all( has_atomic_u32,  not( crossbeam_loom) ) ) ]  
511505impl_arithmetic ! ( i32 ,  atomic:: AtomicI32 ,  "let a = AtomicCell::new(7i32);" ) ; 
512- #[ cfg( has_atomic_u64 ) ]  
506+ #[ cfg( not ( crossbeam_no_atomic_64 ) ) ]  
513507impl_arithmetic ! ( u64 ,  atomic:: AtomicU64 ,  "let a = AtomicCell::new(7u64);" ) ; 
514- #[ cfg( all ( has_atomic_u64 ,   not( crossbeam_loom ) ) ) ]  
508+ #[ cfg( not( crossbeam_no_atomic_64 ) ) ]  
515509impl_arithmetic ! ( i64 ,  atomic:: AtomicI64 ,  "let a = AtomicCell::new(7i64);" ) ; 
516- #[ cfg( all( has_atomic_u128,  not( crossbeam_loom) ) ) ]  
517- impl_arithmetic ! ( u128 ,  atomic:: AtomicU128 ,  "let a = AtomicCell::new(7u128);" ) ; 
518- #[ cfg( all( has_atomic_u128,  not( crossbeam_loom) ) ) ]  
519- impl_arithmetic ! ( i128 ,  atomic:: AtomicI128 ,  "let  a = AtomicCell::new(7i128);" ) ; 
510+ // TODO: AtomicU128 is unstable 
511+ // impl_arithmetic!(u128, atomic::AtomicU128, "let a = AtomicCell::new(7u128);"); 
512+ // impl_arithmetic!(i128, atomic::AtomicI128, "let a = AtomicCell::new(7i128);"); 
520513
521514impl_arithmetic ! ( 
522515    usize , 
@@ -809,16 +802,13 @@ macro_rules! atomic {
809802            atomic!( @check,  $t,  AtomicUnit ,  $a,  $atomic_op) ; 
810803            atomic!( @check,  $t,  atomic:: AtomicUsize ,  $a,  $atomic_op) ; 
811804
812-             #[ cfg( has_atomic_u8) ] 
813805            atomic!( @check,  $t,  atomic:: AtomicU8 ,  $a,  $atomic_op) ; 
814-             #[ cfg( has_atomic_u16) ] 
815806            atomic!( @check,  $t,  atomic:: AtomicU16 ,  $a,  $atomic_op) ; 
816-             #[ cfg( has_atomic_u32) ] 
817807            atomic!( @check,  $t,  atomic:: AtomicU32 ,  $a,  $atomic_op) ; 
818-             #[ cfg( has_atomic_u64 ) ] 
808+             #[ cfg( not ( crossbeam_no_atomic_64 ) ) ] 
819809            atomic!( @check,  $t,  atomic:: AtomicU64 ,  $a,  $atomic_op) ; 
820-             # [ cfg ( has_atomic_u128 ) ] 
821-             atomic!( @check,  $t,  atomic:: AtomicU128 ,  $a,  $atomic_op) ; 
810+             // TODO: AtomicU128 is unstable 
811+             //  atomic!(@check, $t, atomic::AtomicU128, $a, $atomic_op);
822812
823813            #[ cfg( crossbeam_loom) ] 
824814            unimplemented!( "loom does not support non-atomic atomic ops" ) ; 
@@ -831,17 +821,15 @@ macro_rules! atomic {
831821/// Returns `true` if operations on `AtomicCell<T>` are lock-free. 
832822const  fn  atomic_is_lock_free < T > ( )  -> bool  { 
833823    // HACK(taiki-e): This is equivalent to `atomic! { T, _a, true, false }`, but can be used in const fn even in Rust 1.36. 
834-     let  is_lock_free = can_transmute :: < T ,  AtomicUnit > ( )  | can_transmute :: < T ,  atomic:: AtomicUsize > ( ) ; 
835-     #[ cfg( has_atomic_u8) ]  
836-     let  is_lock_free = is_lock_free | can_transmute :: < T ,  atomic:: AtomicU8 > ( ) ; 
837-     #[ cfg( has_atomic_u16) ]  
838-     let  is_lock_free = is_lock_free | can_transmute :: < T ,  atomic:: AtomicU16 > ( ) ; 
839-     #[ cfg( has_atomic_u32) ]  
840-     let  is_lock_free = is_lock_free | can_transmute :: < T ,  atomic:: AtomicU32 > ( ) ; 
841-     #[ cfg( has_atomic_u64) ]  
824+     let  is_lock_free = can_transmute :: < T ,  AtomicUnit > ( ) 
825+         | can_transmute :: < T ,  atomic:: AtomicUsize > ( ) 
826+         | can_transmute :: < T ,  atomic:: AtomicU8 > ( ) 
827+         | can_transmute :: < T ,  atomic:: AtomicU16 > ( ) 
828+         | can_transmute :: < T ,  atomic:: AtomicU32 > ( ) ; 
829+     #[ cfg( not( crossbeam_no_atomic_64) ) ]  
842830    let  is_lock_free = is_lock_free | can_transmute :: < T ,  atomic:: AtomicU64 > ( ) ; 
843-     # [ cfg ( has_atomic_u128 ) ] 
844-     let  is_lock_free = is_lock_free | can_transmute :: < T ,  atomic:: AtomicU128 > ( ) ; 
831+     // TODO: AtomicU128 is unstable 
832+     //  let is_lock_free = is_lock_free | can_transmute::<T, atomic::AtomicU128>();
845833    is_lock_free
846834} 
847835
0 commit comments