summaryrefslogtreecommitdiffstats
path: root/vendor/serde/src/ser
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:11:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:13:23 +0000
commit20431706a863f92cb37dc512fef6e48d192aaf2c (patch)
tree2867f13f5fd5437ba628c67d7f87309ccadcd286 /vendor/serde/src/ser
parentReleasing progress-linux version 1.65.0+dfsg1-2~progress7.99u1. (diff)
downloadrustc-20431706a863f92cb37dc512fef6e48d192aaf2c.tar.xz
rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.zip
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/serde/src/ser')
-rw-r--r--vendor/serde/src/ser/impls.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/vendor/serde/src/ser/impls.rs b/vendor/serde/src/ser/impls.rs
index 7219f51b7..8e8655582 100644
--- a/vendor/serde/src/ser/impls.rs
+++ b/vendor/serde/src/ser/impls.rs
@@ -522,7 +522,7 @@ where
}
}
-impl<T> Serialize for RefCell<T>
+impl<T: ?Sized> Serialize for RefCell<T>
where
T: Serialize,
{
@@ -538,7 +538,7 @@ where
}
#[cfg(feature = "std")]
-impl<T> Serialize for Mutex<T>
+impl<T: ?Sized> Serialize for Mutex<T>
where
T: Serialize,
{
@@ -554,7 +554,7 @@ where
}
#[cfg(feature = "std")]
-impl<T> Serialize for RwLock<T>
+impl<T: ?Sized> Serialize for RwLock<T>
where
T: Serialize,
{
@@ -614,9 +614,10 @@ impl Serialize for SystemTime {
S: Serializer,
{
use super::SerializeStruct;
- let duration_since_epoch = self
- .duration_since(UNIX_EPOCH)
- .map_err(|_| S::Error::custom("SystemTime must be later than UNIX_EPOCH"))?;
+ let duration_since_epoch = match self.duration_since(UNIX_EPOCH) {
+ Ok(duration_since_epoch) => duration_since_epoch,
+ Err(_) => return Err(S::Error::custom("SystemTime must be later than UNIX_EPOCH")),
+ };
let mut state = try!(serializer.serialize_struct("SystemTime", 2));
try!(state.serialize_field("secs_since_epoch", &duration_since_epoch.as_secs()));
try!(state.serialize_field("nanos_since_epoch", &duration_since_epoch.subsec_nanos()));
@@ -916,7 +917,7 @@ macro_rules! atomic_impl {
S: Serializer,
{
// Matches the atomic ordering used in libcore for the Debug impl
- self.load(Ordering::SeqCst).serialize(serializer)
+ self.load(Ordering::Relaxed).serialize(serializer)
}
}
)*