mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-19 08:41:10 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 03eec42c33 | |||
| 196f311ae2 | |||
| 38d9e0b209 | |||
| 6502b31316 | |||
| 6f1a8c3115 | |||
| d883c94cc9 | |||
| 961fa59a74 | |||
| 8bc71def55 | |||
| 7c65a9dc0e |
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.194"
|
version = "1.0.195"
|
||||||
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", "no-std::no-alloc"]
|
categories = ["encoding", "no-std", "no-std::no-alloc"]
|
||||||
@@ -37,7 +37,7 @@ rustdoc-args = ["--cfg", "doc_cfg", "--generate-link-to-definition"]
|
|||||||
# is compatible with exactly one serde release because the generated code
|
# is compatible with exactly one serde release because the generated code
|
||||||
# involves nonpublic APIs which are not bound by semver.
|
# involves nonpublic APIs which are not bound by semver.
|
||||||
[target.'cfg(any())'.dependencies]
|
[target.'cfg(any())'.dependencies]
|
||||||
serde_derive = { version = "=1.0.194", path = "../serde_derive" }
|
serde_derive = { version = "=1.0.195", path = "../serde_derive" }
|
||||||
|
|
||||||
|
|
||||||
### FEATURES #################################################################
|
### FEATURES #################################################################
|
||||||
|
|||||||
+1
-1
@@ -95,7 +95,7 @@
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// 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.194")]
|
#![doc(html_root_url = "https://docs.rs/serde/1.0.195")]
|
||||||
// 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)]
|
||||||
// Show which crate feature enables conditionally compiled APIs in documentation.
|
// Show which crate feature enables conditionally compiled APIs in documentation.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.194"
|
version = "1.0.195"
|
||||||
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", "no-std::no-alloc"]
|
categories = ["no-std", "no-std::no-alloc"]
|
||||||
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
|
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ pub fn with_bound(
|
|||||||
|
|
||||||
fn visit_type(&mut self, ty: &'ast syn::Type) {
|
fn visit_type(&mut self, ty: &'ast syn::Type) {
|
||||||
match ty {
|
match ty {
|
||||||
|
#![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
|
||||||
syn::Type::Array(ty) => self.visit_type(&ty.elem),
|
syn::Type::Array(ty) => self.visit_type(&ty.elem),
|
||||||
syn::Type::BareFn(ty) => {
|
syn::Type::BareFn(ty) => {
|
||||||
for arg in &ty.inputs {
|
for arg in &ty.inputs {
|
||||||
@@ -181,7 +182,6 @@ pub fn with_bound(
|
|||||||
|
|
||||||
syn::Type::Infer(_) | syn::Type::Never(_) | syn::Type::Verbatim(_) => {}
|
syn::Type::Infer(_) | syn::Type::Never(_) | syn::Type::Verbatim(_) => {}
|
||||||
|
|
||||||
#[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -196,16 +196,13 @@ pub fn with_bound(
|
|||||||
syn::PathArguments::AngleBracketed(arguments) => {
|
syn::PathArguments::AngleBracketed(arguments) => {
|
||||||
for arg in &arguments.args {
|
for arg in &arguments.args {
|
||||||
match arg {
|
match arg {
|
||||||
|
#![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
|
||||||
syn::GenericArgument::Type(arg) => self.visit_type(arg),
|
syn::GenericArgument::Type(arg) => self.visit_type(arg),
|
||||||
syn::GenericArgument::AssocType(arg) => self.visit_type(&arg.ty),
|
syn::GenericArgument::AssocType(arg) => self.visit_type(&arg.ty),
|
||||||
syn::GenericArgument::Lifetime(_)
|
syn::GenericArgument::Lifetime(_)
|
||||||
| syn::GenericArgument::Const(_)
|
| syn::GenericArgument::Const(_)
|
||||||
| syn::GenericArgument::AssocConst(_)
|
| syn::GenericArgument::AssocConst(_)
|
||||||
| syn::GenericArgument::Constraint(_) => {}
|
| syn::GenericArgument::Constraint(_) => {}
|
||||||
#[cfg_attr(
|
|
||||||
all(test, exhaustive),
|
|
||||||
deny(non_exhaustive_omitted_patterns)
|
|
||||||
)]
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -228,9 +225,9 @@ pub fn with_bound(
|
|||||||
|
|
||||||
fn visit_type_param_bound(&mut self, bound: &'ast syn::TypeParamBound) {
|
fn visit_type_param_bound(&mut self, bound: &'ast syn::TypeParamBound) {
|
||||||
match bound {
|
match bound {
|
||||||
|
#![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
|
||||||
syn::TypeParamBound::Trait(bound) => self.visit_path(&bound.path),
|
syn::TypeParamBound::Trait(bound) => self.visit_path(&bound.path),
|
||||||
syn::TypeParamBound::Lifetime(_) | syn::TypeParamBound::Verbatim(_) => {}
|
syn::TypeParamBound::Lifetime(_) | syn::TypeParamBound::Verbatim(_) => {}
|
||||||
#[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1794,6 +1794,7 @@ fn borrowable_lifetimes(
|
|||||||
|
|
||||||
fn collect_lifetimes(ty: &syn::Type, out: &mut BTreeSet<syn::Lifetime>) {
|
fn collect_lifetimes(ty: &syn::Type, out: &mut BTreeSet<syn::Lifetime>) {
|
||||||
match ty {
|
match ty {
|
||||||
|
#![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
|
||||||
syn::Type::Slice(ty) => {
|
syn::Type::Slice(ty) => {
|
||||||
collect_lifetimes(&ty.elem, out);
|
collect_lifetimes(&ty.elem, out);
|
||||||
}
|
}
|
||||||
@@ -1829,7 +1830,10 @@ fn collect_lifetimes(ty: &syn::Type, out: &mut BTreeSet<syn::Lifetime>) {
|
|||||||
syn::GenericArgument::AssocType(binding) => {
|
syn::GenericArgument::AssocType(binding) => {
|
||||||
collect_lifetimes(&binding.ty, out);
|
collect_lifetimes(&binding.ty, out);
|
||||||
}
|
}
|
||||||
_ => {}
|
syn::GenericArgument::Const(_)
|
||||||
|
| syn::GenericArgument::AssocConst(_)
|
||||||
|
| syn::GenericArgument::Constraint(_)
|
||||||
|
| _ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1851,7 +1855,6 @@ fn collect_lifetimes(ty: &syn::Type, out: &mut BTreeSet<syn::Lifetime>) {
|
|||||||
| syn::Type::Infer(_)
|
| syn::Type::Infer(_)
|
||||||
| syn::Type::Verbatim(_) => {}
|
| syn::Type::Verbatim(_) => {}
|
||||||
|
|
||||||
#[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ impl ReplaceReceiver<'_> {
|
|||||||
|
|
||||||
fn visit_type_mut_impl(&mut self, ty: &mut Type) {
|
fn visit_type_mut_impl(&mut self, ty: &mut Type) {
|
||||||
match ty {
|
match ty {
|
||||||
|
#![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
|
||||||
Type::Array(ty) => {
|
Type::Array(ty) => {
|
||||||
self.visit_type_mut(&mut ty.elem);
|
self.visit_type_mut(&mut ty.elem);
|
||||||
self.visit_expr_mut(&mut ty.len);
|
self.visit_expr_mut(&mut ty.len);
|
||||||
@@ -147,7 +148,6 @@ impl ReplaceReceiver<'_> {
|
|||||||
|
|
||||||
Type::Infer(_) | Type::Never(_) | Type::Verbatim(_) => {}
|
Type::Infer(_) | Type::Never(_) | Type::Verbatim(_) => {}
|
||||||
|
|
||||||
#[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -178,13 +178,13 @@ impl ReplaceReceiver<'_> {
|
|||||||
PathArguments::AngleBracketed(arguments) => {
|
PathArguments::AngleBracketed(arguments) => {
|
||||||
for arg in &mut arguments.args {
|
for arg in &mut arguments.args {
|
||||||
match arg {
|
match arg {
|
||||||
|
#![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
|
||||||
GenericArgument::Type(arg) => self.visit_type_mut(arg),
|
GenericArgument::Type(arg) => self.visit_type_mut(arg),
|
||||||
GenericArgument::AssocType(arg) => self.visit_type_mut(&mut arg.ty),
|
GenericArgument::AssocType(arg) => self.visit_type_mut(&mut arg.ty),
|
||||||
GenericArgument::Lifetime(_)
|
GenericArgument::Lifetime(_)
|
||||||
| GenericArgument::Const(_)
|
| GenericArgument::Const(_)
|
||||||
| GenericArgument::AssocConst(_)
|
| GenericArgument::AssocConst(_)
|
||||||
| GenericArgument::Constraint(_) => {}
|
| GenericArgument::Constraint(_) => {}
|
||||||
#[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -207,9 +207,9 @@ impl ReplaceReceiver<'_> {
|
|||||||
|
|
||||||
fn visit_type_param_bound_mut(&mut self, bound: &mut TypeParamBound) {
|
fn visit_type_param_bound_mut(&mut self, bound: &mut TypeParamBound) {
|
||||||
match bound {
|
match bound {
|
||||||
|
#![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
|
||||||
TypeParamBound::Trait(bound) => self.visit_path_mut(&mut bound.path),
|
TypeParamBound::Trait(bound) => self.visit_path_mut(&mut bound.path),
|
||||||
TypeParamBound::Lifetime(_) | TypeParamBound::Verbatim(_) => {}
|
TypeParamBound::Lifetime(_) | TypeParamBound::Verbatim(_) => {}
|
||||||
#[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -228,6 +228,7 @@ impl ReplaceReceiver<'_> {
|
|||||||
if let Some(where_clause) = &mut generics.where_clause {
|
if let Some(where_clause) = &mut generics.where_clause {
|
||||||
for predicate in &mut where_clause.predicates {
|
for predicate in &mut where_clause.predicates {
|
||||||
match predicate {
|
match predicate {
|
||||||
|
#![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
|
||||||
WherePredicate::Type(predicate) => {
|
WherePredicate::Type(predicate) => {
|
||||||
self.visit_type_mut(&mut predicate.bounded_ty);
|
self.visit_type_mut(&mut predicate.bounded_ty);
|
||||||
for bound in &mut predicate.bounds {
|
for bound in &mut predicate.bounds {
|
||||||
@@ -235,7 +236,6 @@ impl ReplaceReceiver<'_> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
WherePredicate::Lifetime(_) => {}
|
WherePredicate::Lifetime(_) => {}
|
||||||
#[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.194")]
|
#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.195")]
|
||||||
// Ignored clippy lints
|
// Ignored clippy lints
|
||||||
#![allow(
|
#![allow(
|
||||||
// clippy false positive: https://github.com/rust-lang/rust-clippy/issues/7054
|
// clippy false positive: https://github.com/rust-lang/rust-clippy/issues/7054
|
||||||
|
|||||||
@@ -64,14 +64,14 @@ pub fn pretend_used(cont: &Container, is_packed: bool) -> TokenStream {
|
|||||||
fn pretend_fields_used(cont: &Container, is_packed: bool) -> TokenStream {
|
fn pretend_fields_used(cont: &Container, is_packed: bool) -> TokenStream {
|
||||||
match &cont.data {
|
match &cont.data {
|
||||||
Data::Enum(variants) => pretend_fields_used_enum(cont, variants),
|
Data::Enum(variants) => pretend_fields_used_enum(cont, variants),
|
||||||
Data::Struct(Style::Struct, fields) => {
|
Data::Struct(Style::Struct | Style::Tuple | Style::Newtype, fields) => {
|
||||||
if is_packed {
|
if is_packed {
|
||||||
pretend_fields_used_struct_packed(cont, fields)
|
pretend_fields_used_struct_packed(cont, fields)
|
||||||
} else {
|
} else {
|
||||||
pretend_fields_used_struct(cont, fields)
|
pretend_fields_used_struct(cont, fields)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Data::Struct(_, _) => quote!(),
|
Data::Struct(Style::Unit, _) => quote!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,13 +115,13 @@ fn pretend_fields_used_enum(cont: &Container, variants: &[Variant]) -> TokenStre
|
|||||||
let patterns = variants
|
let patterns = variants
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|variant| match variant.style {
|
.filter_map(|variant| match variant.style {
|
||||||
Style::Struct => {
|
Style::Struct | Style::Tuple | Style::Newtype => {
|
||||||
let variant_ident = &variant.ident;
|
let variant_ident = &variant.ident;
|
||||||
let members = variant.fields.iter().map(|field| &field.member);
|
let members = variant.fields.iter().map(|field| &field.member);
|
||||||
let placeholders = (0usize..).map(|i| format_ident!("__v{}", i));
|
let placeholders = (0usize..).map(|i| format_ident!("__v{}", i));
|
||||||
Some(quote!(#type_ident::#variant_ident { #(#members: #placeholders),* }))
|
Some(quote!(#type_ident::#variant_ident { #(#members: #placeholders),* }))
|
||||||
}
|
}
|
||||||
_ => None,
|
Style::Unit => None,
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
|
|||||||
@@ -686,7 +686,7 @@ fn test_gen() {
|
|||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
enum UntaggedWithBorrow<'a> {
|
pub enum UntaggedWithBorrow<'a> {
|
||||||
Single(#[serde(borrow)] RelObject<'a>),
|
Single(#[serde(borrow)] RelObject<'a>),
|
||||||
Many(#[serde(borrow)] Vec<RelObject<'a>>),
|
Many(#[serde(borrow)] Vec<RelObject<'a>>),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user