mirror of
https://github.com/serde-rs/serde.git
synced 2025-09-30 06:21:26 +00:00
Merge pull request #2333 from jonasbb/remove-trait-bounds
Remove some Serialize trait bounds
This commit is contained in:
commit
34ae0422f4
@ -89,6 +89,7 @@ fn main() {
|
|||||||
println!("cargo:rustc-cfg=no_core_try_from");
|
println!("cargo:rustc-cfg=no_core_try_from");
|
||||||
println!("cargo:rustc-cfg=no_num_nonzero_signed");
|
println!("cargo:rustc-cfg=no_num_nonzero_signed");
|
||||||
println!("cargo:rustc-cfg=no_systemtime_checked_add");
|
println!("cargo:rustc-cfg=no_systemtime_checked_add");
|
||||||
|
println!("cargo:rustc-cfg=no_relaxed_trait_bounds");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Whitelist of archs that support std::sync::atomic module. Ideally we
|
// Whitelist of archs that support std::sync::atomic module. Ideally we
|
||||||
|
@ -182,7 +182,25 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(feature = "std", feature = "alloc"))]
|
#[cfg(all(any(feature = "std", feature = "alloc"), not(no_relaxed_trait_bounds)))]
|
||||||
|
macro_rules! seq_impl {
|
||||||
|
($ty:ident < T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound:ident)* >) => {
|
||||||
|
impl<T $(, $typaram)*> Serialize for $ty<T $(, $typaram)*>
|
||||||
|
where
|
||||||
|
T: Serialize,
|
||||||
|
{
|
||||||
|
#[inline]
|
||||||
|
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||||
|
where
|
||||||
|
S: Serializer,
|
||||||
|
{
|
||||||
|
serializer.collect_seq(self)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(all(any(feature = "std", feature = "alloc"), no_relaxed_trait_bounds))]
|
||||||
macro_rules! seq_impl {
|
macro_rules! seq_impl {
|
||||||
($ty:ident < T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound:ident)* >) => {
|
($ty:ident < T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound:ident)* >) => {
|
||||||
impl<T $(, $typaram)*> Serialize for $ty<T $(, $typaram)*>
|
impl<T $(, $typaram)*> Serialize for $ty<T $(, $typaram)*>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user