diff --git a/serde/src/de/impls.rs b/serde/src/de/impls.rs index 1b93f6381..b2311e1dc 100644 --- a/serde/src/de/impls.rs +++ b/serde/src/de/impls.rs @@ -2662,7 +2662,7 @@ where #[cfg(all(feature = "std", no_target_has_atomic, not(no_std_atomic)))] macro_rules! atomic_impl { - ($($ty:ident)*) => { + ($($ty:ident $size:expr)*) => { $( impl<'de> Deserialize<'de> for $ty { fn deserialize(deserializer: D) -> Result @@ -2678,7 +2678,7 @@ macro_rules! atomic_impl { #[cfg(all(feature = "std", not(no_target_has_atomic)))] macro_rules! atomic_impl { - ($($ty:ident $size:expr),*) => { + ($($ty:ident $size:expr)*) => { $( #[cfg(target_has_atomic = $size)] impl<'de> Deserialize<'de> for $ty { @@ -2695,28 +2695,35 @@ macro_rules! atomic_impl { #[cfg(all(feature = "std", no_target_has_atomic, not(no_std_atomic)))] atomic_impl! { - AtomicBool - AtomicI8 AtomicI16 AtomicI32 AtomicIsize - AtomicU8 AtomicU16 AtomicU32 AtomicUsize + AtomicBool "8" + AtomicI8 "8" + AtomicI16 "16" + AtomicI32 "32" + AtomicIsize "ptr" + AtomicU8 "8" + AtomicU16 "16" + AtomicU32 "32" + AtomicUsize "ptr" } #[cfg(all(feature = "std", no_target_has_atomic, not(no_std_atomic64)))] atomic_impl! { - AtomicI64 AtomicU64 + AtomicI64 "64" + AtomicU64 "64" } #[cfg(all(feature = "std", not(no_target_has_atomic)))] atomic_impl! { - AtomicBool "8", - AtomicI8 "8", - AtomicI16 "16", - AtomicI32 "32", - AtomicI64 "64", - AtomicIsize "ptr", - AtomicU8 "8", - AtomicU16 "16", - AtomicU32 "32", - AtomicU64 "64", + AtomicBool "8" + AtomicI8 "8" + AtomicI16 "16" + AtomicI32 "32" + AtomicI64 "64" + AtomicIsize "ptr" + AtomicU8 "8" + AtomicU16 "16" + AtomicU32 "32" + AtomicU64 "64" AtomicUsize "ptr" } diff --git a/serde/src/ser/impls.rs b/serde/src/ser/impls.rs index e3434460f..4698827be 100644 --- a/serde/src/ser/impls.rs +++ b/serde/src/ser/impls.rs @@ -947,7 +947,7 @@ where #[cfg(all(feature = "std", no_target_has_atomic, not(no_std_atomic)))] macro_rules! atomic_impl { - ($($ty:ident)*) => { + ($($ty:ident $size:expr)*) => { $( impl Serialize for $ty { fn serialize(&self, serializer: S) -> Result @@ -964,7 +964,7 @@ macro_rules! atomic_impl { #[cfg(all(feature = "std", not(no_target_has_atomic)))] macro_rules! atomic_impl { - ($($ty:ident $size:expr),*) => { + ($($ty:ident $size:expr)*) => { $( #[cfg(target_has_atomic = $size)] impl Serialize for $ty { @@ -982,27 +982,34 @@ macro_rules! atomic_impl { #[cfg(all(feature = "std", no_target_has_atomic, not(no_std_atomic)))] atomic_impl! { - AtomicBool - AtomicI8 AtomicI16 AtomicI32 AtomicIsize - AtomicU8 AtomicU16 AtomicU32 AtomicUsize + AtomicBool "8" + AtomicI8 "8" + AtomicI16 "16" + AtomicI32 "32" + AtomicIsize "ptr" + AtomicU8 "8" + AtomicU16 "16" + AtomicU32 "32" + AtomicUsize "ptr" } #[cfg(all(feature = "std", no_target_has_atomic, not(no_std_atomic64)))] atomic_impl! { - AtomicI64 AtomicU64 + AtomicI64 "64" + AtomicU64 "64" } #[cfg(all(feature = "std", not(no_target_has_atomic)))] atomic_impl! { - AtomicBool "8", - AtomicI8 "8", - AtomicI16 "16", - AtomicI32 "32", - AtomicI64 "64", - AtomicIsize "ptr", - AtomicU8 "8", - AtomicU16 "16", - AtomicU32 "32", - AtomicU64 "64", + AtomicBool "8" + AtomicI8 "8" + AtomicI16 "16" + AtomicI32 "32" + AtomicI64 "64" + AtomicIsize "ptr" + AtomicU8 "8" + AtomicU16 "16" + AtomicU32 "32" + AtomicU64 "64" AtomicUsize "ptr" }