mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-27 18:07:57 +00:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 44bf3633af | |||
| f261184416 | |||
| df40f80fcf | |||
| e7060ba83d | |||
| d98f0eea3d | |||
| 4f157a8b81 | |||
| d493649f52 | |||
| 0e947e6c3b | |||
| 9249dab54c | |||
| 7440e56c53 | |||
| 0d79306285 | |||
| 37faaf295e | |||
| 650358fa00 | |||
| 6159ead404 | |||
| 692ac99c69 | |||
| 86161ce15f | |||
| 5361c790bb | |||
| 126730edc8 | |||
| 3aec2a96a8 | |||
| 227d039b1e | |||
| 0353354d61 | |||
| 34ae0422f4 | |||
| cc128feb4c |
@@ -1,6 +1,6 @@
|
|||||||
# Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde: rustc 1.13+]][Rust 1.13] [![serde_derive: rustc 1.31+]][Rust 1.31]
|
# Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde: rustc 1.13+]][Rust 1.13] [![serde_derive: rustc 1.31+]][Rust 1.31]
|
||||||
|
|
||||||
[Build Status]: https://img.shields.io/github/workflow/status/serde-rs/serde/CI/master
|
[Build Status]: https://img.shields.io/github/actions/workflow/status/serde-rs/serde/ci.yml?branch=master
|
||||||
[actions]: https://github.com/serde-rs/serde/actions?query=branch%3Amaster
|
[actions]: https://github.com/serde-rs/serde/actions?query=branch%3Amaster
|
||||||
[Latest Version]: https://img.shields.io/crates/v/serde.svg
|
[Latest Version]: https://img.shields.io/crates/v/serde.svg
|
||||||
[crates.io]: https://crates.io/crates/serde
|
[crates.io]: https://crates.io/crates/serde
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.148" # remember to update html_root_url and serde_derive dependency
|
version = "1.0.151" # remember to update html_root_url and serde_derive dependency
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
categories = ["encoding", "no-std"]
|
categories = ["encoding", "no-std"]
|
||||||
@@ -15,7 +15,7 @@ repository = "https://github.com/serde-rs/serde"
|
|||||||
rust-version = "1.13"
|
rust-version = "1.13"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde_derive = { version = "=1.0.148", optional = true, path = "../serde_derive" }
|
serde_derive = { version = "=1.0.151", optional = true, path = "../serde_derive" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
serde_derive = { version = "1.0", path = "../serde_derive" }
|
serde_derive = { version = "1.0", path = "../serde_derive" }
|
||||||
|
|||||||
+22
-16
@@ -6,6 +6,8 @@ use std::str::{self, FromStr};
|
|||||||
// opening a GitHub issue if your build environment requires some way to enable
|
// opening a GitHub issue if your build environment requires some way to enable
|
||||||
// these cfgs other than by executing our build script.
|
// these cfgs other than by executing our build script.
|
||||||
fn main() {
|
fn main() {
|
||||||
|
println!("cargo:rerun-if-changed=build.rs");
|
||||||
|
|
||||||
let minor = match rustc_minor_version() {
|
let minor = match rustc_minor_version() {
|
||||||
Some(minor) => minor,
|
Some(minor) => minor,
|
||||||
None => return,
|
None => return,
|
||||||
@@ -89,24 +91,28 @@ 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
|
// Support for #[cfg(target_has_atomic = "...")] stabilized in Rust 1.60.
|
||||||
// would use #[cfg(target_has_atomic = "...")] but it is not stable yet.
|
if minor < 60 {
|
||||||
// Instead this is based on rustc's compiler/rustc_target/src/spec/*.rs.
|
println!("cargo:rustc-cfg=no_target_has_atomic");
|
||||||
let has_atomic64 = target.starts_with("x86_64")
|
// Allowlist of archs that support std::sync::atomic module. This is
|
||||||
|| target.starts_with("i686")
|
// based on rustc's compiler/rustc_target/src/spec/*.rs.
|
||||||
|| target.starts_with("aarch64")
|
let has_atomic64 = target.starts_with("x86_64")
|
||||||
|| target.starts_with("powerpc64")
|
|| target.starts_with("i686")
|
||||||
|| target.starts_with("sparc64")
|
|| target.starts_with("aarch64")
|
||||||
|| target.starts_with("mips64el")
|
|| target.starts_with("powerpc64")
|
||||||
|| target.starts_with("riscv64");
|
|| target.starts_with("sparc64")
|
||||||
let has_atomic32 = has_atomic64 || emscripten;
|
|| target.starts_with("mips64el")
|
||||||
if minor < 34 || !has_atomic64 {
|
|| target.starts_with("riscv64");
|
||||||
println!("cargo:rustc-cfg=no_std_atomic64");
|
let has_atomic32 = has_atomic64 || emscripten;
|
||||||
}
|
if minor < 34 || !has_atomic64 {
|
||||||
if minor < 34 || !has_atomic32 {
|
println!("cargo:rustc-cfg=no_std_atomic64");
|
||||||
println!("cargo:rustc-cfg=no_std_atomic");
|
}
|
||||||
|
if minor < 34 || !has_atomic32 {
|
||||||
|
println!("cargo:rustc-cfg=no_std_atomic");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+26
-18
@@ -733,7 +733,7 @@ impl<'de> Deserialize<'de> for CString {
|
|||||||
macro_rules! forwarded_impl {
|
macro_rules! forwarded_impl {
|
||||||
(
|
(
|
||||||
$(#[doc = $doc:tt])*
|
$(#[doc = $doc:tt])*
|
||||||
( $($id: ident),* ), $ty: ty, $func: expr
|
($($id:ident),*), $ty:ty, $func:expr
|
||||||
) => {
|
) => {
|
||||||
$(#[doc = $doc])*
|
$(#[doc = $doc])*
|
||||||
impl<'de $(, $id : Deserialize<'de>,)*> Deserialize<'de> for $ty {
|
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"))]
|
#[cfg(any(feature = "std", feature = "alloc"))]
|
||||||
macro_rules! seq_impl {
|
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,
|
$access:ident,
|
||||||
$clear:expr,
|
$clear:expr,
|
||||||
$with_capacity:expr,
|
$with_capacity:expr,
|
||||||
@@ -1353,7 +1353,7 @@ tuple_impls! {
|
|||||||
#[cfg(any(feature = "std", feature = "alloc"))]
|
#[cfg(any(feature = "std", feature = "alloc"))]
|
||||||
macro_rules! map_impl {
|
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,
|
$access:ident,
|
||||||
$with_capacity:expr
|
$with_capacity:expr
|
||||||
) => {
|
) => {
|
||||||
@@ -1440,15 +1440,15 @@ macro_rules! parse_ip_impl {
|
|||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
macro_rules! variant_identifier {
|
macro_rules! variant_identifier {
|
||||||
(
|
(
|
||||||
$name_kind: ident ( $($variant: ident; $bytes: expr; $index: expr),* )
|
$name_kind:ident ($($variant:ident; $bytes:expr; $index:expr),*)
|
||||||
$expecting_message: expr,
|
$expecting_message:expr,
|
||||||
$variants_name: ident
|
$variants_name:ident
|
||||||
) => {
|
) => {
|
||||||
enum $name_kind {
|
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 {
|
impl<'de> Deserialize<'de> for $name_kind {
|
||||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||||
@@ -1515,12 +1515,12 @@ macro_rules! variant_identifier {
|
|||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
macro_rules! deserialize_enum {
|
macro_rules! deserialize_enum {
|
||||||
(
|
(
|
||||||
$name: ident $name_kind: ident ( $($variant: ident; $bytes: expr; $index: expr),* )
|
$name:ident $name_kind:ident ($($variant:ident; $bytes:expr; $index:expr),*)
|
||||||
$expecting_message: expr,
|
$expecting_message:expr,
|
||||||
$deserializer: expr
|
$deserializer:expr
|
||||||
) => {
|
) => {
|
||||||
variant_identifier!{
|
variant_identifier! {
|
||||||
$name_kind ( $($variant; $bytes; $index),* )
|
$name_kind ($($variant; $bytes; $index),*)
|
||||||
$expecting_message,
|
$expecting_message,
|
||||||
VARIANTS
|
VARIANTS
|
||||||
}
|
}
|
||||||
@@ -2662,8 +2662,9 @@ where
|
|||||||
|
|
||||||
#[cfg(all(feature = "std", not(no_std_atomic)))]
|
#[cfg(all(feature = "std", not(no_std_atomic)))]
|
||||||
macro_rules! atomic_impl {
|
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 {
|
impl<'de> Deserialize<'de> for $ty {
|
||||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||||
where
|
where
|
||||||
@@ -2678,14 +2679,21 @@ macro_rules! atomic_impl {
|
|||||||
|
|
||||||
#[cfg(all(feature = "std", not(no_std_atomic)))]
|
#[cfg(all(feature = "std", not(no_std_atomic)))]
|
||||||
atomic_impl! {
|
atomic_impl! {
|
||||||
AtomicBool
|
AtomicBool "8"
|
||||||
AtomicI8 AtomicI16 AtomicI32 AtomicIsize
|
AtomicI8 "8"
|
||||||
AtomicU8 AtomicU16 AtomicU32 AtomicUsize
|
AtomicI16 "16"
|
||||||
|
AtomicI32 "32"
|
||||||
|
AtomicIsize "ptr"
|
||||||
|
AtomicU8 "8"
|
||||||
|
AtomicU16 "16"
|
||||||
|
AtomicU32 "32"
|
||||||
|
AtomicUsize "ptr"
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(feature = "std", not(no_std_atomic64)))]
|
#[cfg(all(feature = "std", not(no_std_atomic64)))]
|
||||||
atomic_impl! {
|
atomic_impl! {
|
||||||
AtomicI64 AtomicU64
|
AtomicI64 "64"
|
||||||
|
AtomicU64 "64"
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
|
|||||||
+18
-5
@@ -81,14 +81,14 @@
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Serde types in rustdoc of other crates get linked to here.
|
// Serde types in rustdoc of other crates get linked to here.
|
||||||
#![doc(html_root_url = "https://docs.rs/serde/1.0.148")]
|
#![doc(html_root_url = "https://docs.rs/serde/1.0.151")]
|
||||||
// Support using Serde without the standard library!
|
// Support using Serde without the standard library!
|
||||||
#![cfg_attr(not(feature = "std"), no_std)]
|
#![cfg_attr(not(feature = "std"), no_std)]
|
||||||
// Unstable functionality only if the user asks for it. For tracking and
|
// Unstable functionality only if the user asks for it. For tracking and
|
||||||
// discussion of these features please refer to this issue:
|
// discussion of these features please refer to this issue:
|
||||||
//
|
//
|
||||||
// https://github.com/serde-rs/serde/issues/812
|
// https://github.com/serde-rs/serde/issues/812
|
||||||
#![cfg_attr(feature = "unstable", feature(never_type))]
|
#![cfg_attr(feature = "unstable", feature(error_in_core, never_type))]
|
||||||
#![allow(unknown_lints, bare_trait_objects, deprecated)]
|
#![allow(unknown_lints, bare_trait_objects, deprecated)]
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
|
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
|
||||||
// Ignored clippy and clippy_pedantic lints
|
// Ignored clippy and clippy_pedantic lints
|
||||||
@@ -236,14 +236,27 @@ mod lib {
|
|||||||
#[cfg(not(no_range_inclusive))]
|
#[cfg(not(no_range_inclusive))]
|
||||||
pub use self::core::ops::RangeInclusive;
|
pub use self::core::ops::RangeInclusive;
|
||||||
|
|
||||||
#[cfg(all(feature = "std", not(no_std_atomic)))]
|
#[cfg(all(feature = "std", no_target_has_atomic, not(no_std_atomic)))]
|
||||||
pub use std::sync::atomic::{
|
pub use std::sync::atomic::{
|
||||||
AtomicBool, AtomicI16, AtomicI32, AtomicI8, AtomicIsize, AtomicU16, AtomicU32, AtomicU8,
|
AtomicBool, AtomicI16, AtomicI32, AtomicI8, AtomicIsize, AtomicU16, AtomicU32, AtomicU8,
|
||||||
AtomicUsize, Ordering,
|
AtomicUsize, Ordering,
|
||||||
};
|
};
|
||||||
#[cfg(all(feature = "std", not(no_std_atomic64)))]
|
#[cfg(all(feature = "std", no_target_has_atomic, not(no_std_atomic64)))]
|
||||||
pub use std::sync::atomic::{AtomicI64, AtomicU64};
|
pub use std::sync::atomic::{AtomicI64, AtomicU64};
|
||||||
|
|
||||||
|
#[cfg(all(feature = "std", not(no_target_has_atomic)))]
|
||||||
|
pub use std::sync::atomic::Ordering;
|
||||||
|
#[cfg(all(feature = "std", not(no_target_has_atomic), target_has_atomic = "8"))]
|
||||||
|
pub use std::sync::atomic::{AtomicBool, AtomicI8, AtomicU8};
|
||||||
|
#[cfg(all(feature = "std", not(no_target_has_atomic), target_has_atomic = "16"))]
|
||||||
|
pub use std::sync::atomic::{AtomicI16, AtomicU16};
|
||||||
|
#[cfg(all(feature = "std", not(no_target_has_atomic), target_has_atomic = "32"))]
|
||||||
|
pub use std::sync::atomic::{AtomicI32, AtomicU32};
|
||||||
|
#[cfg(all(feature = "std", not(no_target_has_atomic), target_has_atomic = "64"))]
|
||||||
|
pub use std::sync::atomic::{AtomicI64, AtomicU64};
|
||||||
|
#[cfg(all(feature = "std", not(no_target_has_atomic), target_has_atomic = "ptr"))]
|
||||||
|
pub use std::sync::atomic::{AtomicIsize, AtomicUsize};
|
||||||
|
|
||||||
#[cfg(any(feature = "std", not(no_core_duration)))]
|
#[cfg(any(feature = "std", not(no_core_duration)))]
|
||||||
pub use self::core::time::Duration;
|
pub use self::core::time::Duration;
|
||||||
}
|
}
|
||||||
@@ -290,7 +303,7 @@ use self::__private as private;
|
|||||||
#[path = "de/seed.rs"]
|
#[path = "de/seed.rs"]
|
||||||
mod seed;
|
mod seed;
|
||||||
|
|
||||||
#[cfg(not(feature = "std"))]
|
#[cfg(not(any(feature = "std", feature = "unstable")))]
|
||||||
mod std_error;
|
mod std_error;
|
||||||
|
|
||||||
// Re-export #[derive(Serialize, Deserialize)].
|
// Re-export #[derive(Serialize, Deserialize)].
|
||||||
|
|||||||
@@ -2708,7 +2708,7 @@ where
|
|||||||
|
|
||||||
#[cfg(any(feature = "std", feature = "alloc"))]
|
#[cfg(any(feature = "std", feature = "alloc"))]
|
||||||
macro_rules! forward_to_deserialize_other {
|
macro_rules! forward_to_deserialize_other {
|
||||||
($($func:ident ( $($arg:ty),* ))*) => {
|
($($func:ident ($($arg:ty),*))*) => {
|
||||||
$(
|
$(
|
||||||
fn $func<V>(self, $(_: $arg,)* _visitor: V) -> Result<V::Value, Self::Error>
|
fn $func<V>(self, $(_: $arg,)* _visitor: V) -> Result<V::Value, Self::Error>
|
||||||
where
|
where
|
||||||
|
|||||||
+55
-10
@@ -182,9 +182,27 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(feature = "std", feature = "alloc"))]
|
#[cfg(all(any(feature = "std", feature = "alloc"), not(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)*>
|
||||||
|
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 {
|
||||||
|
($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)*>
|
||||||
where
|
where
|
||||||
T: Serialize $(+ $tbound1 $(+ $tbound2)*)*,
|
T: Serialize $(+ $tbound1 $(+ $tbound2)*)*,
|
||||||
@@ -347,9 +365,28 @@ tuple_impls! {
|
|||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#[cfg(any(feature = "std", feature = "alloc"))]
|
#[cfg(all(any(feature = "std", feature = "alloc"), not(no_relaxed_trait_bounds)))]
|
||||||
macro_rules! map_impl {
|
macro_rules! map_impl {
|
||||||
($ty:ident < K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound:ident)* >) => {
|
($ty:ident <K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound:ident)*>) => {
|
||||||
|
impl<K, V $(, $typaram)*> Serialize for $ty<K, V $(, $typaram)*>
|
||||||
|
where
|
||||||
|
K: Serialize,
|
||||||
|
V: Serialize,
|
||||||
|
{
|
||||||
|
#[inline]
|
||||||
|
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||||
|
where
|
||||||
|
S: Serializer,
|
||||||
|
{
|
||||||
|
serializer.collect_map(self)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(all(any(feature = "std", feature = "alloc"), no_relaxed_trait_bounds))]
|
||||||
|
macro_rules! map_impl {
|
||||||
|
($ty:ident <K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound:ident)*>) => {
|
||||||
impl<K, V $(, $typaram)*> Serialize for $ty<K, V $(, $typaram)*>
|
impl<K, V $(, $typaram)*> Serialize for $ty<K, V $(, $typaram)*>
|
||||||
where
|
where
|
||||||
K: Serialize $(+ $kbound1 $(+ $kbound2)*)*,
|
K: Serialize $(+ $kbound1 $(+ $kbound2)*)*,
|
||||||
@@ -465,7 +502,7 @@ where
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
macro_rules! nonzero_integers {
|
macro_rules! nonzero_integers {
|
||||||
( $( $T: ident, )+ ) => {
|
($($T:ident,)+) => {
|
||||||
$(
|
$(
|
||||||
#[cfg(not(no_num_nonzero))]
|
#[cfg(not(no_num_nonzero))]
|
||||||
impl Serialize for num::$T {
|
impl Serialize for num::$T {
|
||||||
@@ -910,8 +947,9 @@ where
|
|||||||
|
|
||||||
#[cfg(all(feature = "std", not(no_std_atomic)))]
|
#[cfg(all(feature = "std", not(no_std_atomic)))]
|
||||||
macro_rules! atomic_impl {
|
macro_rules! atomic_impl {
|
||||||
($($ty:ident)*) => {
|
($($ty:ident $size:expr)*) => {
|
||||||
$(
|
$(
|
||||||
|
#[cfg(any(no_target_has_atomic, target_has_atomic = $size))]
|
||||||
impl Serialize for $ty {
|
impl Serialize for $ty {
|
||||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||||
where
|
where
|
||||||
@@ -927,12 +965,19 @@ macro_rules! atomic_impl {
|
|||||||
|
|
||||||
#[cfg(all(feature = "std", not(no_std_atomic)))]
|
#[cfg(all(feature = "std", not(no_std_atomic)))]
|
||||||
atomic_impl! {
|
atomic_impl! {
|
||||||
AtomicBool
|
AtomicBool "8"
|
||||||
AtomicI8 AtomicI16 AtomicI32 AtomicIsize
|
AtomicI8 "8"
|
||||||
AtomicU8 AtomicU16 AtomicU32 AtomicUsize
|
AtomicI16 "16"
|
||||||
|
AtomicI32 "32"
|
||||||
|
AtomicIsize "ptr"
|
||||||
|
AtomicU8 "8"
|
||||||
|
AtomicU16 "16"
|
||||||
|
AtomicU32 "32"
|
||||||
|
AtomicUsize "ptr"
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(feature = "std", not(no_std_atomic64)))]
|
#[cfg(all(feature = "std", not(no_std_atomic64)))]
|
||||||
atomic_impl! {
|
atomic_impl! {
|
||||||
AtomicI64 AtomicU64
|
AtomicI64 "64"
|
||||||
|
AtomicU64 "64"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,10 +115,13 @@ mod impossible;
|
|||||||
|
|
||||||
pub use self::impossible::Impossible;
|
pub use self::impossible::Impossible;
|
||||||
|
|
||||||
|
#[cfg(all(feature = "unstable", not(feature = "std")))]
|
||||||
|
#[doc(inline)]
|
||||||
|
pub use core::error::Error as StdError;
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
#[doc(no_inline)]
|
#[doc(no_inline)]
|
||||||
pub use std::error::Error as StdError;
|
pub use std::error::Error as StdError;
|
||||||
#[cfg(not(feature = "std"))]
|
#[cfg(not(any(feature = "std", feature = "unstable")))]
|
||||||
#[doc(no_inline)]
|
#[doc(no_inline)]
|
||||||
pub use std_error::Error as StdError;
|
pub use std_error::Error as StdError;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.148" # remember to update html_root_url
|
version = "1.0.151" # remember to update html_root_url
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
||||||
categories = ["no-std"]
|
categories = ["no-std"]
|
||||||
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
|
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ use std::str;
|
|||||||
// opening a GitHub issue if your build environment requires some way to enable
|
// opening a GitHub issue if your build environment requires some way to enable
|
||||||
// these cfgs other than by executing our build script.
|
// these cfgs other than by executing our build script.
|
||||||
fn main() {
|
fn main() {
|
||||||
|
println!("cargo:rerun-if-changed=build.rs");
|
||||||
|
|
||||||
let minor = match rustc_minor_version() {
|
let minor = match rustc_minor_version() {
|
||||||
Some(minor) => minor,
|
Some(minor) => minor,
|
||||||
None => return,
|
None => return,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
//!
|
//!
|
||||||
//! [https://serde.rs/derive.html]: https://serde.rs/derive.html
|
//! [https://serde.rs/derive.html]: https://serde.rs/derive.html
|
||||||
|
|
||||||
#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.148")]
|
#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.151")]
|
||||||
#![allow(unknown_lints, bare_trait_objects)]
|
#![allow(unknown_lints, bare_trait_objects)]
|
||||||
// Ignored clippy lints
|
// Ignored clippy lints
|
||||||
#![allow(
|
#![allow(
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
println!("cargo:rerun-if-changed=build.rs");
|
||||||
|
println!("cargo:rerun-if-changed=src/mod.rs");
|
||||||
|
|
||||||
// Sometimes on Windows the git checkout does not correctly wire up the
|
// Sometimes on Windows the git checkout does not correctly wire up the
|
||||||
// symlink from serde_derive_internals/src to serde_derive/src/internals.
|
// symlink from serde_derive_internals/src to serde_derive/src/internals.
|
||||||
// When this happens we'll just build based on relative paths within the git
|
// When this happens we'll just build based on relative paths within the git
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_test"
|
name = "serde_test"
|
||||||
version = "1.0.148" # remember to update html_root_url
|
version = "1.0.151" # remember to update html_root_url
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
categories = ["development-tools::testing"]
|
categories = ["development-tools::testing"]
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ use std::str::{self, FromStr};
|
|||||||
// opening a GitHub issue if your build environment requires some way to enable
|
// opening a GitHub issue if your build environment requires some way to enable
|
||||||
// these cfgs other than by executing our build script.
|
// these cfgs other than by executing our build script.
|
||||||
fn main() {
|
fn main() {
|
||||||
|
println!("cargo:rerun-if-changed=build.rs");
|
||||||
|
|
||||||
let minor = match rustc_minor_version() {
|
let minor = match rustc_minor_version() {
|
||||||
Some(minor) => minor,
|
Some(minor) => minor,
|
||||||
None => return,
|
None => return,
|
||||||
|
|||||||
@@ -144,7 +144,7 @@
|
|||||||
//! # }
|
//! # }
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
#![doc(html_root_url = "https://docs.rs/serde_test/1.0.148")]
|
#![doc(html_root_url = "https://docs.rs/serde_test/1.0.151")]
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
|
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
|
||||||
// Ignored clippy lints
|
// Ignored clippy lints
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, needless_doctest_main))]
|
#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, needless_doctest_main))]
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ fn has_cargo_expand() -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
println!("cargo:rerun-if-changed=build.rs");
|
||||||
|
|
||||||
if cfg!(feature = "expandtest") && has_cargo_expand() {
|
if cfg!(feature = "expandtest") && has_cargo_expand() {
|
||||||
println!("cargo:rustc-cfg=expandtest");
|
println!("cargo:rustc-cfg=expandtest");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user