mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-28 18:27:55 +00:00
Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a587eb8953 | |||
| 990f7eb6c1 | |||
| 082e18f9a1 | |||
| f309485787 | |||
| e2f85681fe | |||
| 8b840c3030 | |||
| 9c39115f82 | |||
| 89342af71e | |||
| 3c5e2d11f6 | |||
| 3805c037a8 | |||
| 7045fee260 | |||
| 9d81532e41 | |||
| 5e47432ef0 | |||
| 7b840897a9 | |||
| 967795414b | |||
| 985725f820 | |||
| 0c303d85d7 | |||
| f68e9e901e | |||
| 1094e2d334 | |||
| d9c338ec4a | |||
| 699bf3a75d | |||
| dd29825217 | |||
| 6366f17da7 | |||
| 1120e5af4a | |||
| 1093f7e232 | |||
| 2ea132b8c4 | |||
| 2ebc771b88 | |||
| c17c4eef18 | |||
| 7aa4950504 | |||
| 47015a2727 | |||
| dc4c31eb50 | |||
| b53ebef438 | |||
| 6c3bf7a2fc | |||
| ce0844b9ec |
@@ -23,25 +23,22 @@ jobs:
|
|||||||
- run: cd test_suite && cargo test --features unstable -- --skip ui --exact
|
- run: cd test_suite && cargo test --features unstable -- --skip ui --exact
|
||||||
|
|
||||||
stable:
|
stable:
|
||||||
name: Rust stable
|
name: Rust ${{matrix.rust}}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
rust: [stable, beta]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@master
|
||||||
|
with:
|
||||||
|
toolchain: ${{matrix.rust}}
|
||||||
- run: cd serde && cargo build --features rc
|
- run: cd serde && cargo build --features rc
|
||||||
- run: cd serde && cargo build --no-default-features
|
- run: cd serde && cargo build --no-default-features
|
||||||
- run: cd serde_test && cargo build
|
- run: cd serde_test && cargo build
|
||||||
- run: cd serde_test && cargo test --features serde/derive,serde/rc
|
- run: cd serde_test && cargo test --features serde/derive,serde/rc
|
||||||
|
|
||||||
beta:
|
|
||||||
name: Rust beta
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: dtolnay/rust-toolchain@beta
|
|
||||||
- run: cd serde && cargo build --features rc
|
|
||||||
- run: cd test_suite && cargo test
|
|
||||||
|
|
||||||
nightly:
|
nightly:
|
||||||
name: Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}}
|
name: Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}}
|
||||||
runs-on: ${{matrix.os}}-latest
|
runs-on: ${{matrix.os}}-latest
|
||||||
|
|||||||
+4
-10
@@ -31,25 +31,19 @@ tests for you.
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Test all the example code in Serde documentation
|
# Test all the example code in Serde documentation
|
||||||
cargo test
|
cargo test --features derive
|
||||||
```
|
|
||||||
|
|
||||||
##### In the [`test_suite/deps`] directory
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# This is a prerequisite for running the full test suite
|
|
||||||
cargo clean && cargo update && cargo build
|
|
||||||
```
|
```
|
||||||
|
|
||||||
##### In the [`test_suite`] directory
|
##### In the [`test_suite`] directory
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Run the full test suite, including tests of unstable functionality
|
# Run the full test suite, including tests of unstable functionality
|
||||||
cargo test --features unstable
|
cargo +nightly test --features unstable
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note that this test suite currently only supports running on a nightly compiler.
|
||||||
|
|
||||||
[`serde`]: https://github.com/serde-rs/serde/tree/master/serde
|
[`serde`]: https://github.com/serde-rs/serde/tree/master/serde
|
||||||
[`test_suite/deps`]: https://github.com/serde-rs/serde/tree/master/test_suite/deps
|
|
||||||
[`test_suite`]: https://github.com/serde-rs/serde/tree/master/test_suite
|
[`test_suite`]: https://github.com/serde-rs/serde/tree/master/test_suite
|
||||||
|
|
||||||
## Conduct
|
## Conduct
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.125" # remember to update html_root_url and serde_derive dependency
|
version = "1.0.128" # 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>"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
description = "A generic serialization/deserialization framework"
|
description = "A generic serialization/deserialization framework"
|
||||||
@@ -14,7 +14,7 @@ include = ["build.rs", "src/**/*.rs", "crates-io.md", "README.md", "LICENSE-APAC
|
|||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde_derive = { version = "=1.0.125", optional = true, path = "../serde_derive" }
|
serde_derive = { version = "=1.0.128", 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" }
|
||||||
|
|||||||
+4
-3
@@ -53,9 +53,10 @@ fn main() {
|
|||||||
// 128-bit integers stabilized in Rust 1.26:
|
// 128-bit integers stabilized in Rust 1.26:
|
||||||
// https://blog.rust-lang.org/2018/05/10/Rust-1.26.html
|
// https://blog.rust-lang.org/2018/05/10/Rust-1.26.html
|
||||||
//
|
//
|
||||||
// Disabled on Emscripten targets as Emscripten doesn't
|
// Disabled on Emscripten targets before Rust 1.40 since
|
||||||
// currently support integers larger than 64 bits.
|
// Emscripten did not support 128-bit integers until Rust 1.40
|
||||||
if minor >= 26 && !emscripten {
|
// (https://github.com/rust-lang/rust/pull/65251)
|
||||||
|
if minor >= 26 && (!emscripten || minor >= 40) {
|
||||||
println!("cargo:rustc-cfg=integer128");
|
println!("cargo:rustc-cfg=integer128");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1007,7 +1007,7 @@ pub trait Deserializer<'de>: Sized {
|
|||||||
/// `Deserializer`.
|
/// `Deserializer`.
|
||||||
///
|
///
|
||||||
/// If the `Visitor` would benefit from taking ownership of `String` data,
|
/// If the `Visitor` would benefit from taking ownership of `String` data,
|
||||||
/// indiciate this to the `Deserializer` by using `deserialize_string`
|
/// indicate this to the `Deserializer` by using `deserialize_string`
|
||||||
/// instead.
|
/// instead.
|
||||||
fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error>
|
fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error>
|
||||||
where
|
where
|
||||||
|
|||||||
+1
-1
@@ -84,7 +84,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.125")]
|
#![doc(html_root_url = "https://docs.rs/serde/1.0.128")]
|
||||||
// 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
|
||||||
|
|||||||
@@ -2832,7 +2832,7 @@ where
|
|||||||
where
|
where
|
||||||
T: DeserializeSeed<'de>,
|
T: DeserializeSeed<'de>,
|
||||||
{
|
{
|
||||||
while let Some(item) = self.iter.next() {
|
for item in &mut self.iter {
|
||||||
// Items in the vector are nulled out when used by a struct.
|
// Items in the vector are nulled out when used by a struct.
|
||||||
if let Some((ref key, ref content)) = *item {
|
if let Some((ref key, ref content)) = *item {
|
||||||
self.pending_content = Some(content);
|
self.pending_content = Some(content);
|
||||||
@@ -2934,7 +2934,7 @@ where
|
|||||||
where
|
where
|
||||||
T: DeserializeSeed<'de>,
|
T: DeserializeSeed<'de>,
|
||||||
{
|
{
|
||||||
while let Some(item) = self.iter.next() {
|
for item in &mut self.iter {
|
||||||
if let Some((ref key, ref content)) = *item {
|
if let Some((ref key, ref content)) = *item {
|
||||||
// Do not take(), instead borrow this entry. The internally tagged
|
// Do not take(), instead borrow this entry. The internally tagged
|
||||||
// enum does its own buffering so we can't tell whether this entry
|
// enum does its own buffering so we can't tell whether this entry
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.125" # remember to update html_root_url
|
version = "1.0.128" # 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>"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
|
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ pub fn with_where_predicates_from_fields(
|
|||||||
let predicates = cont
|
let predicates = cont
|
||||||
.data
|
.data
|
||||||
.all_fields()
|
.all_fields()
|
||||||
.flat_map(|field| from_field(&field.attrs))
|
.filter_map(|field| from_field(&field.attrs))
|
||||||
.flat_map(|predicates| predicates.to_vec());
|
.flat_map(|predicates| predicates.to_vec());
|
||||||
|
|
||||||
let mut generics = generics.clone();
|
let mut generics = generics.clone();
|
||||||
@@ -71,7 +71,7 @@ pub fn with_where_predicates_from_variants(
|
|||||||
|
|
||||||
let predicates = variants
|
let predicates = variants
|
||||||
.iter()
|
.iter()
|
||||||
.flat_map(|variant| from_variant(&variant.attrs))
|
.filter_map(|variant| from_variant(&variant.attrs))
|
||||||
.flat_map(|predicates| predicates.to_vec());
|
.flat_map(|predicates| predicates.to_vec());
|
||||||
|
|
||||||
let mut generics = generics.clone();
|
let mut generics = generics.clone();
|
||||||
|
|||||||
@@ -475,7 +475,7 @@ fn deserialize_tuple(
|
|||||||
};
|
};
|
||||||
|
|
||||||
let visit_seq = Stmts(deserialize_seq(
|
let visit_seq = Stmts(deserialize_seq(
|
||||||
&type_path, params, fields, false, cattrs, &expecting,
|
&type_path, params, fields, false, cattrs, expecting,
|
||||||
));
|
));
|
||||||
|
|
||||||
let visitor_expr = quote! {
|
let visitor_expr = quote! {
|
||||||
@@ -561,7 +561,7 @@ fn deserialize_tuple_in_place(
|
|||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
let visit_seq = Stmts(deserialize_seq_in_place(params, fields, cattrs, &expecting));
|
let visit_seq = Stmts(deserialize_seq_in_place(params, fields, cattrs, expecting));
|
||||||
|
|
||||||
let visitor_expr = quote! {
|
let visitor_expr = quote! {
|
||||||
__Visitor {
|
__Visitor {
|
||||||
@@ -922,7 +922,7 @@ fn deserialize_struct(
|
|||||||
let expecting = cattrs.expecting().unwrap_or(&expecting);
|
let expecting = cattrs.expecting().unwrap_or(&expecting);
|
||||||
|
|
||||||
let visit_seq = Stmts(deserialize_seq(
|
let visit_seq = Stmts(deserialize_seq(
|
||||||
&type_path, params, fields, true, cattrs, &expecting,
|
&type_path, params, fields, true, cattrs, expecting,
|
||||||
));
|
));
|
||||||
|
|
||||||
let (field_visitor, fields_stmt, visit_map) = if cattrs.has_flatten() {
|
let (field_visitor, fields_stmt, visit_map) = if cattrs.has_flatten() {
|
||||||
@@ -1063,7 +1063,7 @@ fn deserialize_struct_in_place(
|
|||||||
};
|
};
|
||||||
let expecting = cattrs.expecting().unwrap_or(&expecting);
|
let expecting = cattrs.expecting().unwrap_or(&expecting);
|
||||||
|
|
||||||
let visit_seq = Stmts(deserialize_seq_in_place(params, fields, cattrs, &expecting));
|
let visit_seq = Stmts(deserialize_seq_in_place(params, fields, cattrs, expecting));
|
||||||
|
|
||||||
let (field_visitor, fields_stmt, visit_map) =
|
let (field_visitor, fields_stmt, visit_map) =
|
||||||
deserialize_struct_as_struct_in_place_visitor(params, fields, cattrs);
|
deserialize_struct_as_struct_in_place_visitor(params, fields, cattrs);
|
||||||
@@ -2087,7 +2087,7 @@ fn deserialize_identifier(
|
|||||||
) -> Fragment {
|
) -> Fragment {
|
||||||
let mut flat_fields = Vec::new();
|
let mut flat_fields = Vec::new();
|
||||||
for (_, ident, aliases) in fields {
|
for (_, ident, aliases) in fields {
|
||||||
flat_fields.extend(aliases.iter().map(|alias| (alias, ident)))
|
flat_fields.extend(aliases.iter().map(|alias| (alias, ident)));
|
||||||
}
|
}
|
||||||
|
|
||||||
let field_strs: &Vec<_> = &flat_fields.iter().map(|(name, _)| name).collect();
|
let field_strs: &Vec<_> = &flat_fields.iter().map(|(name, _)| name).collect();
|
||||||
@@ -2285,7 +2285,7 @@ fn deserialize_identifier(
|
|||||||
};
|
};
|
||||||
|
|
||||||
let visit_borrowed = if fallthrough_borrowed.is_some() || collect_other_fields {
|
let visit_borrowed = if fallthrough_borrowed.is_some() || collect_other_fields {
|
||||||
let fallthrough_borrowed_arm = fallthrough_borrowed.as_ref().unwrap_or(&fallthrough_arm);
|
let fallthrough_borrowed_arm = fallthrough_borrowed.as_ref().unwrap_or(fallthrough_arm);
|
||||||
Some(quote! {
|
Some(quote! {
|
||||||
fn visit_borrowed_str<__E>(self, __value: &'de str) -> _serde::__private::Result<Self::Value, __E>
|
fn visit_borrowed_str<__E>(self, __value: &'de str) -> _serde::__private::Result<Self::Value, __E>
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ pub fn wrap_in_const(
|
|||||||
use #path as _serde;
|
use #path as _serde;
|
||||||
},
|
},
|
||||||
None => quote! {
|
None => quote! {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ pub struct Container<'a> {
|
|||||||
|
|
||||||
/// The fields of a struct or enum.
|
/// The fields of a struct or enum.
|
||||||
///
|
///
|
||||||
/// Analagous to `syn::Data`.
|
/// Analogous to `syn::Data`.
|
||||||
pub enum Data<'a> {
|
pub enum Data<'a> {
|
||||||
Enum(Vec<Variant<'a>>),
|
Enum(Vec<Variant<'a>>),
|
||||||
Struct(Style, Vec<Field<'a>>),
|
Struct(Style, Vec<Field<'a>>),
|
||||||
|
|||||||
@@ -556,7 +556,7 @@ impl Container {
|
|||||||
// Parse `#[serde(crate = "foo")]`
|
// Parse `#[serde(crate = "foo")]`
|
||||||
Meta(NameValue(m)) if m.path == CRATE => {
|
Meta(NameValue(m)) if m.path == CRATE => {
|
||||||
if let Ok(path) = parse_lit_into_path(cx, CRATE, &m.lit) {
|
if let Ok(path) = parse_lit_into_path(cx, CRATE, &m.lit) {
|
||||||
serde_path.set(&m.path, path)
|
serde_path.set(&m.path, path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1609,7 +1609,7 @@ fn get_lit_str2<'a>(
|
|||||||
fn parse_lit_into_path(cx: &Ctxt, attr_name: Symbol, lit: &syn::Lit) -> Result<syn::Path, ()> {
|
fn parse_lit_into_path(cx: &Ctxt, attr_name: Symbol, lit: &syn::Lit) -> Result<syn::Path, ()> {
|
||||||
let string = get_lit_str(cx, attr_name, lit)?;
|
let string = get_lit_str(cx, attr_name, lit)?;
|
||||||
parse_lit_str(string).map_err(|_| {
|
parse_lit_str(string).map_err(|_| {
|
||||||
cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()))
|
cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()));
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1620,7 +1620,7 @@ fn parse_lit_into_expr_path(
|
|||||||
) -> Result<syn::ExprPath, ()> {
|
) -> Result<syn::ExprPath, ()> {
|
||||||
let string = get_lit_str(cx, attr_name, lit)?;
|
let string = get_lit_str(cx, attr_name, lit)?;
|
||||||
parse_lit_str(string).map_err(|_| {
|
parse_lit_str(string).map_err(|_| {
|
||||||
cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()))
|
cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()));
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1649,7 +1649,7 @@ fn parse_lit_into_ty(cx: &Ctxt, attr_name: Symbol, lit: &syn::Lit) -> Result<syn
|
|||||||
cx.error_spanned_by(
|
cx.error_spanned_by(
|
||||||
lit,
|
lit,
|
||||||
format!("failed to parse type: {} = {:?}", attr_name, string.value()),
|
format!("failed to parse type: {} = {:?}", attr_name, string.value()),
|
||||||
)
|
);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ fn check_internal_tag_field_name_conflict(cx: &Ctxt, cont: &Container) {
|
|||||||
cx.error_spanned_by(
|
cx.error_spanned_by(
|
||||||
cont.original,
|
cont.original,
|
||||||
format!("variant field name `{}` conflicts with internal tag", tag),
|
format!("variant field name `{}` conflicts with internal tag", tag),
|
||||||
)
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
for variant in variants {
|
for variant in variants {
|
||||||
@@ -396,7 +396,7 @@ fn member_message(member: &Member) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn allow_transparent(field: &Field, derive: Derive) -> bool {
|
fn allow_transparent(field: &Field, derive: Derive) -> bool {
|
||||||
if let Type::Path(ty) = ungroup(&field.ty) {
|
if let Type::Path(ty) = ungroup(field.ty) {
|
||||||
if let Some(seg) = ty.path.segments.last() {
|
if let Some(seg) = ty.path.segments.last() {
|
||||||
if seg.ident == "PhantomData" {
|
if seg.ident == "PhantomData" {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -13,12 +13,16 @@
|
|||||||
//!
|
//!
|
||||||
//! [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.125")]
|
#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.128")]
|
||||||
#![allow(unknown_lints, bare_trait_objects)]
|
#![allow(unknown_lints, bare_trait_objects)]
|
||||||
#![deny(clippy::all, clippy::pedantic)]
|
#![deny(clippy::all, clippy::pedantic)]
|
||||||
// Ignored clippy lints
|
// Ignored clippy lints
|
||||||
#![allow(
|
#![allow(
|
||||||
|
// clippy false positive: https://github.com/rust-lang/rust-clippy/issues/7054
|
||||||
|
clippy::branches_sharing_code,
|
||||||
clippy::cognitive_complexity,
|
clippy::cognitive_complexity,
|
||||||
|
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/7575
|
||||||
|
clippy::collapsible_match,
|
||||||
clippy::enum_variant_names,
|
clippy::enum_variant_names,
|
||||||
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/6797
|
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/6797
|
||||||
clippy::manual_map,
|
clippy::manual_map,
|
||||||
@@ -37,12 +41,13 @@
|
|||||||
clippy::checked_conversions,
|
clippy::checked_conversions,
|
||||||
clippy::doc_markdown,
|
clippy::doc_markdown,
|
||||||
clippy::enum_glob_use,
|
clippy::enum_glob_use,
|
||||||
clippy::filter_map,
|
|
||||||
clippy::indexing_slicing,
|
clippy::indexing_slicing,
|
||||||
clippy::items_after_statements,
|
clippy::items_after_statements,
|
||||||
clippy::let_underscore_drop,
|
clippy::let_underscore_drop,
|
||||||
clippy::map_err_ignore,
|
clippy::map_err_ignore,
|
||||||
clippy::match_same_arms,
|
clippy::match_same_arms,
|
||||||
|
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/6984
|
||||||
|
clippy::match_wildcard_for_single_variants,
|
||||||
clippy::module_name_repetitions,
|
clippy::module_name_repetitions,
|
||||||
clippy::must_use_candidate,
|
clippy::must_use_candidate,
|
||||||
clippy::option_if_let_else,
|
clippy::option_if_let_else,
|
||||||
|
|||||||
@@ -1099,7 +1099,7 @@ fn serialize_struct_visitor(
|
|||||||
let mut field_expr = if is_enum {
|
let mut field_expr = if is_enum {
|
||||||
quote!(#member)
|
quote!(#member)
|
||||||
} else {
|
} else {
|
||||||
get_member(params, field, &member)
|
get_member(params, field, member)
|
||||||
};
|
};
|
||||||
|
|
||||||
let key_expr = field.attrs.name().serialize_name();
|
let key_expr = field.attrs.name().serialize_name();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_derive_internals"
|
name = "serde_derive_internals"
|
||||||
version = "0.25.0" # remember to update html_root_url
|
version = "0.26.0" # 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>"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
description = "AST representation used by Serde derive macros. Unstable."
|
description = "AST representation used by Serde derive macros. Unstable."
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
use std::path::Path;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
// Sometimes on Windows the git checkout does not correctly wire up the
|
||||||
|
// 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
|
||||||
|
// repo.
|
||||||
|
let mod_behind_symlink = Path::new("src/mod.rs");
|
||||||
|
if !mod_behind_symlink.exists() {
|
||||||
|
println!("cargo:rustc-cfg=serde_build_from_git");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
#![doc(html_root_url = "https://docs.rs/serde_derive_internals/0.25.0")]
|
#![doc(html_root_url = "https://docs.rs/serde_derive_internals/0.26.0")]
|
||||||
#![allow(unknown_lints, bare_trait_objects)]
|
#![allow(unknown_lints, bare_trait_objects)]
|
||||||
#![deny(clippy::all, clippy::pedantic)]
|
#![deny(clippy::all, clippy::pedantic)]
|
||||||
// Ignored clippy lints
|
// Ignored clippy lints
|
||||||
#![allow(
|
#![allow(
|
||||||
clippy::cognitive_complexity,
|
clippy::cognitive_complexity,
|
||||||
|
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/7575
|
||||||
|
clippy::collapsible_match,
|
||||||
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/6797
|
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/6797
|
||||||
clippy::manual_map,
|
clippy::manual_map,
|
||||||
clippy::missing_panics_doc,
|
clippy::missing_panics_doc,
|
||||||
@@ -22,6 +24,8 @@
|
|||||||
clippy::items_after_statements,
|
clippy::items_after_statements,
|
||||||
clippy::let_underscore_drop,
|
clippy::let_underscore_drop,
|
||||||
clippy::match_same_arms,
|
clippy::match_same_arms,
|
||||||
|
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/6984
|
||||||
|
clippy::match_wildcard_for_single_variants,
|
||||||
clippy::missing_errors_doc,
|
clippy::missing_errors_doc,
|
||||||
clippy::module_name_repetitions,
|
clippy::module_name_repetitions,
|
||||||
clippy::must_use_candidate,
|
clippy::must_use_candidate,
|
||||||
@@ -38,7 +42,8 @@ extern crate syn;
|
|||||||
extern crate proc_macro2;
|
extern crate proc_macro2;
|
||||||
extern crate quote;
|
extern crate quote;
|
||||||
|
|
||||||
#[path = "src/mod.rs"]
|
#[cfg_attr(serde_build_from_git, path = "../serde_derive/src/internals/mod.rs")]
|
||||||
|
#[cfg_attr(not(serde_build_from_git), path = "src/mod.rs")]
|
||||||
mod internals;
|
mod internals;
|
||||||
|
|
||||||
pub use internals::*;
|
pub use internals::*;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_test"
|
name = "serde_test"
|
||||||
version = "1.0.125" # remember to update html_root_url
|
version = "1.0.128" # 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>"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
description = "Token De/Serializer for testing De/Serialize implementations"
|
description = "Token De/Serializer for testing De/Serialize implementations"
|
||||||
|
|||||||
@@ -144,7 +144,7 @@
|
|||||||
//! # }
|
//! # }
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
#![doc(html_root_url = "https://docs.rs/serde_test/1.0.125")]
|
#![doc(html_root_url = "https://docs.rs/serde_test/1.0.128")]
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
|
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
|
||||||
#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
|
#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
|
||||||
// Ignored clippy lints
|
// Ignored clippy lints
|
||||||
@@ -153,6 +153,7 @@
|
|||||||
#![cfg_attr(
|
#![cfg_attr(
|
||||||
feature = "cargo-clippy",
|
feature = "cargo-clippy",
|
||||||
allow(
|
allow(
|
||||||
|
cloned_instead_of_copied,
|
||||||
empty_line_after_outer_attr,
|
empty_line_after_outer_attr,
|
||||||
missing_docs_in_private_items,
|
missing_docs_in_private_items,
|
||||||
missing_panics_doc,
|
missing_panics_doc,
|
||||||
|
|||||||
@@ -32,18 +32,18 @@ impl<'a> Serializer<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! assert_next_token {
|
macro_rules! assert_next_token {
|
||||||
($ser:expr, $actual:ident) => {
|
($ser:expr, $actual:ident) => {{
|
||||||
assert_next_token!($ser, stringify!($actual), Token::$actual, true);
|
assert_next_token!($ser, stringify!($actual), Token::$actual, true);
|
||||||
};
|
}};
|
||||||
($ser:expr, $actual:ident($v:expr)) => {
|
($ser:expr, $actual:ident($v:expr)) => {{
|
||||||
assert_next_token!(
|
assert_next_token!(
|
||||||
$ser,
|
$ser,
|
||||||
format_args!(concat!(stringify!($actual), "({:?})"), $v),
|
format_args!(concat!(stringify!($actual), "({:?})"), $v),
|
||||||
Token::$actual(v),
|
Token::$actual(v),
|
||||||
v == $v
|
v == $v
|
||||||
);
|
);
|
||||||
};
|
}};
|
||||||
($ser:expr, $actual:ident { $($k:ident),* }) => {
|
($ser:expr, $actual:ident { $($k:ident),* }) => {{
|
||||||
let compare = ($($k,)*);
|
let compare = ($($k,)*);
|
||||||
let field_format = || {
|
let field_format = || {
|
||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
@@ -59,7 +59,7 @@ macro_rules! assert_next_token {
|
|||||||
Token::$actual { $($k),* },
|
Token::$actual { $($k),* },
|
||||||
($($k,)*) == compare
|
($($k,)*) == compare
|
||||||
);
|
);
|
||||||
};
|
}};
|
||||||
($ser:expr, $actual:expr, $pat:pat, $guard:expr) => {
|
($ser:expr, $actual:expr, $pat:pat, $guard:expr) => {
|
||||||
match $ser.next_token() {
|
match $ser.next_token() {
|
||||||
Some($pat) if $guard => {}
|
Some($pat) if $guard => {}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ enum DeEnum<B, C, D> {
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<B, C, D> _serde::Serialize for DeEnum<B, C, D>
|
impl<B, C, D> _serde::Serialize for DeEnum<B, C, D>
|
||||||
@@ -265,7 +265,7 @@ const _: () = {
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<'de, B, C, D> _serde::Deserialize<'de> for DeEnum<B, C, D>
|
impl<'de, B, C, D> _serde::Deserialize<'de> for DeEnum<B, C, D>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ struct DefaultTyParam<T: AssociatedType<X = i32> = i32> {
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<T: AssociatedType<X = i32>> _serde::Serialize for DefaultTyParam<T> {
|
impl<T: AssociatedType<X = i32>> _serde::Serialize for DefaultTyParam<T> {
|
||||||
@@ -49,7 +49,7 @@ const _: () = {
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<'de, T: AssociatedType<X = i32>> _serde::Deserialize<'de> for DefaultTyParam<T> {
|
impl<'de, T: AssociatedType<X = i32>> _serde::Deserialize<'de> for DefaultTyParam<T> {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ pub enum GenericEnum<T, U> {
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<T, U> _serde::Serialize for GenericEnum<T, U>
|
impl<T, U> _serde::Serialize for GenericEnum<T, U>
|
||||||
@@ -114,7 +114,7 @@ const _: () = {
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<'de, T, U> _serde::Deserialize<'de> for GenericEnum<T, U>
|
impl<'de, T, U> _serde::Deserialize<'de> for GenericEnum<T, U>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ pub struct GenericStruct<T> {
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<T> _serde::Serialize for GenericStruct<T>
|
impl<T> _serde::Serialize for GenericStruct<T>
|
||||||
@@ -42,7 +42,7 @@ const _: () = {
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<'de, T> _serde::Deserialize<'de> for GenericStruct<T>
|
impl<'de, T> _serde::Deserialize<'de> for GenericStruct<T>
|
||||||
@@ -410,7 +410,7 @@ pub struct GenericNewTypeStruct<T>(T);
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<T> _serde::Serialize for GenericNewTypeStruct<T>
|
impl<T> _serde::Serialize for GenericNewTypeStruct<T>
|
||||||
@@ -435,7 +435,7 @@ const _: () = {
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<'de, T> _serde::Deserialize<'de> for GenericNewTypeStruct<T>
|
impl<'de, T> _serde::Deserialize<'de> for GenericNewTypeStruct<T>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ pub struct GenericTupleStruct<T, U>(T, U);
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<'de, T, U> _serde::Deserialize<'de> for GenericTupleStruct<T, U>
|
impl<'de, T, U> _serde::Deserialize<'de> for GenericTupleStruct<T, U>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ enum Lifetimes<'a> {
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<'a> _serde::Serialize for Lifetimes<'a> {
|
impl<'a> _serde::Serialize for Lifetimes<'a> {
|
||||||
@@ -95,7 +95,7 @@ const _: () = {
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<'de, 'a> _serde::Deserialize<'de> for Lifetimes<'a> {
|
impl<'de, 'a> _serde::Deserialize<'de> for Lifetimes<'a> {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ struct SerNamedMap<'a, 'b, A: 'a, B: 'b, C> {
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<'a, 'b, A: 'a, B: 'b, C> _serde::Serialize for SerNamedMap<'a, 'b, A, B, C>
|
impl<'a, 'b, A: 'a, B: 'b, C> _serde::Serialize for SerNamedMap<'a, 'b, A, B, C>
|
||||||
@@ -63,7 +63,7 @@ struct DeNamedMap<A, B, C> {
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<'de, A, B, C> _serde::Deserialize<'de> for DeNamedMap<A, B, C>
|
impl<'de, A, B, C> _serde::Deserialize<'de> for DeNamedMap<A, B, C>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ struct SerNamedTuple<'a, 'b, A: 'a, B: 'b, C>(&'a A, &'b mut B, C);
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<'a, 'b, A: 'a, B: 'b, C> _serde::Serialize for SerNamedTuple<'a, 'b, A, B, C>
|
impl<'a, 'b, A: 'a, B: 'b, C> _serde::Serialize for SerNamedTuple<'a, 'b, A, B, C>
|
||||||
@@ -55,7 +55,7 @@ struct DeNamedTuple<A, B, C>(A, B, C);
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<'de, A, B, C> _serde::Deserialize<'de> for DeNamedTuple<A, B, C>
|
impl<'de, A, B, C> _serde::Deserialize<'de> for DeNamedTuple<A, B, C>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ struct NamedUnit;
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl _serde::Serialize for NamedUnit {
|
impl _serde::Serialize for NamedUnit {
|
||||||
@@ -21,7 +21,7 @@ const _: () = {
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<'de> _serde::Deserialize<'de> for NamedUnit {
|
impl<'de> _serde::Deserialize<'de> for NamedUnit {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ where
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<'a, B: 'a, C: 'a, D> _serde::Serialize for SerEnum<'a, B, C, D>
|
impl<'a, B: 'a, C: 'a, D> _serde::Serialize for SerEnum<'a, B, C, D>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ enum Void {}
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl _serde::Serialize for Void {
|
impl _serde::Serialize for Void {
|
||||||
@@ -21,7 +21,7 @@ const _: () = {
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
||||||
const _: () = {
|
const _: () = {
|
||||||
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
#[allow(unused_extern_crates, clippy::useless_attribute)]
|
||||||
extern crate serde as _serde;
|
extern crate serde as _serde;
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
impl<'de> _serde::Deserialize<'de> for Void {
|
impl<'de> _serde::Deserialize<'de> for Void {
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#![allow(
|
#![allow(
|
||||||
clippy::cast_lossless,
|
clippy::cast_lossless,
|
||||||
clippy::from_over_into,
|
clippy::from_over_into,
|
||||||
|
// Clippy bug: https://github.com/rust-lang/rust-clippy/issues/7422
|
||||||
|
clippy::nonstandard_macro_braces,
|
||||||
clippy::trivially_copy_pass_by_ref
|
clippy::trivially_copy_pass_by_ref
|
||||||
)]
|
)]
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,11 @@
|
|||||||
// types involved.
|
// types involved.
|
||||||
|
|
||||||
#![deny(warnings)]
|
#![deny(warnings)]
|
||||||
#![cfg_attr(feature = "unstable", feature(non_ascii_idents))]
|
|
||||||
#![allow(
|
#![allow(
|
||||||
unknown_lints,
|
unknown_lints,
|
||||||
mixed_script_confusables,
|
mixed_script_confusables,
|
||||||
|
// Clippy bug: https://github.com/rust-lang/rust-clippy/issues/7422
|
||||||
|
clippy::nonstandard_macro_braces,
|
||||||
clippy::ptr_arg,
|
clippy::ptr_arg,
|
||||||
clippy::trivially_copy_pass_by_ref
|
clippy::trivially_copy_pass_by_ref
|
||||||
)]
|
)]
|
||||||
@@ -267,7 +268,6 @@ fn test_gen() {
|
|||||||
}
|
}
|
||||||
assert::<EmptyEnumVariant>();
|
assert::<EmptyEnumVariant>();
|
||||||
|
|
||||||
#[cfg(feature = "unstable")]
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
struct NonAsciiIdents {
|
struct NonAsciiIdents {
|
||||||
σ: f64,
|
σ: f64,
|
||||||
@@ -643,7 +643,7 @@ fn test_gen() {
|
|||||||
assert::<SkippedVariant<X>>();
|
assert::<SkippedVariant<X>>();
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
struct ImpliciltyBorrowedOption<'a> {
|
struct ImplicitlyBorrowedOption<'a> {
|
||||||
option: std::option::Option<&'a str>,
|
option: std::option::Option<&'a str>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1923,7 +1923,7 @@ fn test_internally_tagged_newtype_variant_containing_unit_struct() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deny(safe_packed_borrows)]
|
#[deny(unaligned_references)]
|
||||||
#[test]
|
#[test]
|
||||||
fn test_packed_struct_can_derive_serialize() {
|
fn test_packed_struct_can_derive_serialize() {
|
||||||
#[derive(Copy, Clone, Serialize)]
|
#[derive(Copy, Clone, Serialize)]
|
||||||
|
|||||||
@@ -7,4 +7,4 @@ error[E0308]: mismatched types
|
|||||||
| expected `u16`, found `u8`
|
| expected `u16`, found `u8`
|
||||||
| help: you can convert a `u8` to a `u16`: `Deserialize.into()`
|
| help: you can convert a `u8` to a `u16`: `Deserialize.into()`
|
||||||
|
|
|
|
||||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ error[E0308]: mismatched types
|
|||||||
|
|
|
|
||||||
= note: expected reference `&u8`
|
= note: expected reference `&u8`
|
||||||
found reference `&u16`
|
found reference `&u16`
|
||||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ error[E0308]: mismatched types
|
|||||||
|
|
|
|
||||||
= note: expected reference `&u8`
|
= note: expected reference `&u8`
|
||||||
found reference `&u16`
|
found reference `&u16`
|
||||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ error: #[serde(tag = "...")] can only be used on enums and structs with named fi
|
|||||||
3 | #[derive(Serialize)]
|
3 | #[derive(Serialize)]
|
||||||
| ^^^^^^^^^
|
| ^^^^^^^^^
|
||||||
|
|
|
|
||||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|||||||
Reference in New Issue
Block a user