diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:41 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:41 +0000 |
commit | 4f9fe856a25ab29345b90e7725509e9ee38a37be (patch) | |
tree | e4ffd8a9374cae7b21f7cbfb352927e0e074aff6 /vendor/serde/src/de/impls.rs | |
parent | Adding upstream version 1.68.2+dfsg1. (diff) | |
download | rustc-5cd5bd4daf55da04d2c8e7c06c3067a027cfbfc2.tar.xz rustc-5cd5bd4daf55da04d2c8e7c06c3067a027cfbfc2.zip |
Adding upstream version 1.69.0+dfsg1.upstream/1.69.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | vendor/serde/src/de/impls.rs | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/vendor/serde/src/de/impls.rs b/vendor/serde/src/de/impls.rs index c048f7145..a257d9e2f 100644 --- a/vendor/serde/src/de/impls.rs +++ b/vendor/serde/src/de/impls.rs @@ -733,7 +733,7 @@ impl<'de> Deserialize<'de> for CString { macro_rules! forwarded_impl { ( $(#[doc = $doc:tt])* - ( $($id: ident),* ), $ty: ty, $func: expr + ($($id:ident),*), $ty:ty, $func:expr ) => { $(#[doc = $doc])* impl<'de $(, $id : Deserialize<'de>,)*> Deserialize<'de> for $ty { @@ -860,7 +860,7 @@ impl<'de, T: ?Sized> Deserialize<'de> for PhantomData<T> { #[cfg(any(feature = "std", feature = "alloc"))] macro_rules! seq_impl { ( - $ty:ident < T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound1:ident $(+ $bound2:ident)*)* >, + $ty:ident <T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound1:ident $(+ $bound2:ident)*)*>, $access:ident, $clear:expr, $with_capacity:expr, @@ -1353,7 +1353,7 @@ tuple_impls! { #[cfg(any(feature = "std", feature = "alloc"))] macro_rules! map_impl { ( - $ty:ident < K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound1:ident $(+ $bound2:ident)*)* >, + $ty:ident <K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound1:ident $(+ $bound2:ident)*)*>, $access:ident, $with_capacity:expr ) => { @@ -1440,15 +1440,15 @@ macro_rules! parse_ip_impl { #[cfg(feature = "std")] macro_rules! variant_identifier { ( - $name_kind: ident ( $($variant: ident; $bytes: expr; $index: expr),* ) - $expecting_message: expr, - $variants_name: ident + $name_kind:ident ($($variant:ident; $bytes:expr; $index:expr),*) + $expecting_message:expr, + $variants_name:ident ) => { enum $name_kind { - $( $variant ),* + $($variant),* } - static $variants_name: &'static [&'static str] = &[ $( stringify!($variant) ),*]; + static $variants_name: &'static [&'static str] = &[$(stringify!($variant)),*]; impl<'de> Deserialize<'de> for $name_kind { fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> @@ -1515,12 +1515,12 @@ macro_rules! variant_identifier { #[cfg(feature = "std")] macro_rules! deserialize_enum { ( - $name: ident $name_kind: ident ( $($variant: ident; $bytes: expr; $index: expr),* ) - $expecting_message: expr, - $deserializer: expr + $name:ident $name_kind:ident ($($variant:ident; $bytes:expr; $index:expr),*) + $expecting_message:expr, + $deserializer:expr ) => { - variant_identifier!{ - $name_kind ( $($variant; $bytes; $index),* ) + variant_identifier! { + $name_kind ($($variant; $bytes; $index),*) $expecting_message, VARIANTS } @@ -2662,8 +2662,9 @@ where #[cfg(all(feature = "std", not(no_std_atomic)))] macro_rules! atomic_impl { - ($($ty:ident)*) => { + ($($ty:ident $size:expr)*) => { $( + #[cfg(any(no_target_has_atomic, target_has_atomic = $size))] impl<'de> Deserialize<'de> for $ty { fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where @@ -2678,14 +2679,21 @@ macro_rules! atomic_impl { #[cfg(all(feature = "std", 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", not(no_std_atomic64)))] atomic_impl! { - AtomicI64 AtomicU64 + AtomicI64 "64" + AtomicU64 "64" } #[cfg(feature = "std")] |