File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2660,27 +2660,11 @@ where
26602660 }
26612661}
26622662
2663- #[ cfg( all( feature = "std" , no_target_has_atomic, not( no_std_atomic) ) ) ]
2664- macro_rules! atomic_impl {
2665- ( $( $ty: ident $size: expr) * ) => {
2666- $(
2667- impl <' de> Deserialize <' de> for $ty {
2668- fn deserialize<D >( deserializer: D ) -> Result <Self , D :: Error >
2669- where
2670- D : Deserializer <' de>,
2671- {
2672- Deserialize :: deserialize( deserializer) . map( Self :: new)
2673- }
2674- }
2675- ) *
2676- } ;
2677- }
2678-
2679- #[ cfg( all( feature = "std" , not( no_target_has_atomic) ) ) ]
2663+ #[ cfg( all( feature = "std" , not( no_std_atomic) ) ) ]
26802664macro_rules! atomic_impl {
26812665 ( $( $ty: ident $size: expr) * ) => {
26822666 $(
2683- #[ cfg( target_has_atomic = $size) ]
2667+ #[ cfg( any ( no_target_has_atomic , target_has_atomic = $size) ) ]
26842668 impl <' de> Deserialize <' de> for $ty {
26852669 fn deserialize<D >( deserializer: D ) -> Result <Self , D :: Error >
26862670 where
Original file line number Diff line number Diff line change @@ -945,28 +945,11 @@ where
945945
946946////////////////////////////////////////////////////////////////////////////////
947947
948- #[ cfg( all( feature = "std" , no_target_has_atomic, not( no_std_atomic) ) ) ]
949- macro_rules! atomic_impl {
950- ( $( $ty: ident $size: expr) * ) => {
951- $(
952- impl Serialize for $ty {
953- fn serialize<S >( & self , serializer: S ) -> Result <S :: Ok , S :: Error >
954- where
955- S : Serializer ,
956- {
957- // Matches the atomic ordering used in libcore for the Debug impl
958- self . load( Ordering :: Relaxed ) . serialize( serializer)
959- }
960- }
961- ) *
962- }
963- }
964-
965- #[ cfg( all( feature = "std" , not( no_target_has_atomic) ) ) ]
948+ #[ cfg( all( feature = "std" , not( no_std_atomic) ) ) ]
966949macro_rules! atomic_impl {
967950 ( $( $ty: ident $size: expr) * ) => {
968951 $(
969- #[ cfg( target_has_atomic = $size) ]
952+ #[ cfg( any ( no_target_has_atomic , target_has_atomic = $size) ) ]
970953 impl Serialize for $ty {
971954 fn serialize<S >( & self , serializer: S ) -> Result <S :: Ok , S :: Error >
972955 where
You can’t perform that action at this time.
0 commit comments