mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-28 11:27:57 +00:00
Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7bfd518dd4 | |||
| 723a9491e2 | |||
| 2b44efb085 | |||
| 03dc0fc137 | |||
| 85cb0c478e | |||
| abe7194480 | |||
| aaccac7413 | |||
| 7cd4d84cac | |||
| 04ff3e8f95 | |||
| dc3031b614 | |||
| 1e2f931d0c | |||
| 930401b0dd | |||
| cb6eaea151 | |||
| b6f339ca36 | |||
| 2a5caea1a8 | |||
| b9f93f99aa | |||
| eb5cd476ba | |||
| 8478a3b7dd | |||
| dbb909136e | |||
| ad8dd4148b | |||
| f91d2ed9ae | |||
| 9497463718 | |||
| 46e9ecfcdd | |||
| e9c399c822 | |||
| b9dbfcb4ac | |||
| c270e27a4d | |||
| 0307f604ea |
@@ -52,6 +52,7 @@ jobs:
|
|||||||
toolchain: ${{matrix.rust}}
|
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 test_suite/no_std && cargo build
|
||||||
|
|
||||||
nightly:
|
nightly:
|
||||||
name: Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}}
|
name: Rust nightly ${{matrix.os == 'windows' && '(windows)' || ''}}
|
||||||
|
|||||||
+2
-4
@@ -1,4 +1,2 @@
|
|||||||
target/
|
/target/
|
||||||
**/*.rs.bk
|
/Cargo.lock
|
||||||
*.sw[po]
|
|
||||||
Cargo.lock
|
|
||||||
|
|||||||
+8
-6
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.215"
|
version = "1.0.218"
|
||||||
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"]
|
||||||
@@ -20,16 +20,18 @@ serde_derive = { version = "1", optional = true, path = "../serde_derive" }
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
serde_derive = { version = "1", path = "../serde_derive" }
|
serde_derive = { version = "1", path = "../serde_derive" }
|
||||||
|
|
||||||
[lib]
|
|
||||||
doc-scrape-examples = false
|
|
||||||
|
|
||||||
[package.metadata.playground]
|
[package.metadata.playground]
|
||||||
features = ["derive", "rc"]
|
features = ["derive", "rc"]
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
features = ["derive", "rc", "unstable"]
|
features = ["derive", "rc", "unstable"]
|
||||||
targets = ["x86_64-unknown-linux-gnu"]
|
targets = ["x86_64-unknown-linux-gnu"]
|
||||||
rustdoc-args = ["--generate-link-to-definition"]
|
rustdoc-args = [
|
||||||
|
"--generate-link-to-definition",
|
||||||
|
"--extern-html-root-url=core=https://doc.rust-lang.org",
|
||||||
|
"--extern-html-root-url=alloc=https://doc.rust-lang.org",
|
||||||
|
"--extern-html-root-url=std=https://doc.rust-lang.org",
|
||||||
|
]
|
||||||
|
|
||||||
# This cfg cannot be enabled, but it still forces Cargo to keep serde_derive's
|
# This cfg cannot be enabled, but it still forces Cargo to keep serde_derive's
|
||||||
# version in lockstep with serde's, even if someone depends on the two crates
|
# version in lockstep with serde's, even if someone depends on the two crates
|
||||||
@@ -37,7 +39,7 @@ rustdoc-args = ["--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.215", path = "../serde_derive" }
|
serde_derive = { version = "=1.0.218", path = "../serde_derive" }
|
||||||
|
|
||||||
|
|
||||||
### FEATURES #################################################################
|
### FEATURES #################################################################
|
||||||
|
|||||||
+5
-23
@@ -1,6 +1,6 @@
|
|||||||
use std::env;
|
use std::env;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
use std::str::{self, FromStr};
|
use std::str;
|
||||||
|
|
||||||
// The rustc-cfg strings below are *not* public API. Please let us know by
|
// The rustc-cfg strings below are *not* public API. Please let us know by
|
||||||
// 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
|
||||||
@@ -108,30 +108,12 @@ fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn rustc_minor_version() -> Option<u32> {
|
fn rustc_minor_version() -> Option<u32> {
|
||||||
let rustc = match env::var_os("RUSTC") {
|
let rustc = env::var_os("RUSTC")?;
|
||||||
Some(rustc) => rustc,
|
let output = Command::new(rustc).arg("--version").output().ok()?;
|
||||||
None => return None,
|
let version = str::from_utf8(&output.stdout).ok()?;
|
||||||
};
|
|
||||||
|
|
||||||
let output = match Command::new(rustc).arg("--version").output() {
|
|
||||||
Ok(output) => output,
|
|
||||||
Err(_) => return None,
|
|
||||||
};
|
|
||||||
|
|
||||||
let version = match str::from_utf8(&output.stdout) {
|
|
||||||
Ok(version) => version,
|
|
||||||
Err(_) => return None,
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut pieces = version.split('.');
|
let mut pieces = version.split('.');
|
||||||
if pieces.next() != Some("rustc 1") {
|
if pieces.next() != Some("rustc 1") {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
pieces.next()?.parse().ok()
|
||||||
let next = match pieces.next() {
|
|
||||||
Some(next) => next,
|
|
||||||
None => return None,
|
|
||||||
};
|
|
||||||
|
|
||||||
u32::from_str(next).ok()
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -101,8 +101,8 @@
|
|||||||
//! - SocketAddrV6
|
//! - SocketAddrV6
|
||||||
//!
|
//!
|
||||||
//! [Implementing `Deserialize`]: https://serde.rs/impl-deserialize.html
|
//! [Implementing `Deserialize`]: https://serde.rs/impl-deserialize.html
|
||||||
//! [`Deserialize`]: ../trait.Deserialize.html
|
//! [`Deserialize`]: crate::Deserialize
|
||||||
//! [`Deserializer`]: ../trait.Deserializer.html
|
//! [`Deserializer`]: crate::Deserializer
|
||||||
//! [`LinkedHashMap<K, V>`]: https://docs.rs/linked-hash-map/*/linked_hash_map/struct.LinkedHashMap.html
|
//! [`LinkedHashMap<K, V>`]: https://docs.rs/linked-hash-map/*/linked_hash_map/struct.LinkedHashMap.html
|
||||||
//! [`postcard`]: https://github.com/jamesmunns/postcard
|
//! [`postcard`]: https://github.com/jamesmunns/postcard
|
||||||
//! [`linked-hash-map`]: https://crates.io/crates/linked-hash-map
|
//! [`linked-hash-map`]: https://crates.io/crates/linked-hash-map
|
||||||
|
|||||||
+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.215")]
|
#![doc(html_root_url = "https://docs.rs/serde/1.0.218")]
|
||||||
// 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.
|
||||||
|
|||||||
+3
-3
@@ -104,9 +104,9 @@
|
|||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [`Deserializer`]: trait.Deserializer.html
|
/// [`Deserializer`]: crate::Deserializer
|
||||||
/// [`Visitor`]: de/trait.Visitor.html
|
/// [`Visitor`]: crate::de::Visitor
|
||||||
/// [`Deserializer::deserialize_any`]: trait.Deserializer.html#tymethod.deserialize_any
|
/// [`Deserializer::deserialize_any`]: crate::Deserializer::deserialize_any
|
||||||
#[macro_export(local_inner_macros)]
|
#[macro_export(local_inner_macros)]
|
||||||
macro_rules! forward_to_deserialize_any {
|
macro_rules! forward_to_deserialize_any {
|
||||||
(<$visitor:ident: Visitor<$lifetime:tt>> $($func:ident)*) => {
|
(<$visitor:ident: Visitor<$lifetime:tt>> $($func:ident)*) => {
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ enum Unsupported {
|
|||||||
Sequence,
|
Sequence,
|
||||||
Tuple,
|
Tuple,
|
||||||
TupleStruct,
|
TupleStruct,
|
||||||
|
#[cfg(not(any(feature = "std", feature = "alloc")))]
|
||||||
Enum,
|
Enum,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,6 +71,7 @@ impl Display for Unsupported {
|
|||||||
Unsupported::Sequence => formatter.write_str("a sequence"),
|
Unsupported::Sequence => formatter.write_str("a sequence"),
|
||||||
Unsupported::Tuple => formatter.write_str("a tuple"),
|
Unsupported::Tuple => formatter.write_str("a tuple"),
|
||||||
Unsupported::TupleStruct => formatter.write_str("a tuple struct"),
|
Unsupported::TupleStruct => formatter.write_str("a tuple struct"),
|
||||||
|
#[cfg(not(any(feature = "std", feature = "alloc")))]
|
||||||
Unsupported::Enum => formatter.write_str("an enum"),
|
Unsupported::Enum => formatter.write_str("an enum"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1095,9 +1097,9 @@ where
|
|||||||
self,
|
self,
|
||||||
_: &'static str,
|
_: &'static str,
|
||||||
_: u32,
|
_: u32,
|
||||||
_: &'static str,
|
variant: &'static str,
|
||||||
) -> Result<Self::Ok, Self::Error> {
|
) -> Result<Self::Ok, Self::Error> {
|
||||||
Err(Self::bad_type(Unsupported::Enum))
|
self.0.serialize_entry(variant, &())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn serialize_newtype_struct<T>(
|
fn serialize_newtype_struct<T>(
|
||||||
|
|||||||
@@ -49,14 +49,14 @@ use crate::ser::{
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [`Serializer`]: trait.Serializer.html
|
/// [`Serializer`]: crate::Serializer
|
||||||
/// [`SerializeSeq`]: trait.SerializeSeq.html
|
/// [`SerializeSeq`]: crate::ser::SerializeSeq
|
||||||
/// [`SerializeTuple`]: trait.SerializeTuple.html
|
/// [`SerializeTuple`]: crate::ser::SerializeTuple
|
||||||
/// [`SerializeTupleStruct`]: trait.SerializeTupleStruct.html
|
/// [`SerializeTupleStruct`]: crate::ser::SerializeTupleStruct
|
||||||
/// [`SerializeTupleVariant`]: trait.SerializeTupleVariant.html
|
/// [`SerializeTupleVariant`]: crate::ser::SerializeTupleVariant
|
||||||
/// [`SerializeMap`]: trait.SerializeMap.html
|
/// [`SerializeMap`]: crate::ser::SerializeMap
|
||||||
/// [`SerializeStruct`]: trait.SerializeStruct.html
|
/// [`SerializeStruct`]: crate::ser::SerializeStruct
|
||||||
/// [`SerializeStructVariant`]: trait.SerializeStructVariant.html
|
/// [`SerializeStructVariant`]: crate::ser::SerializeStructVariant
|
||||||
pub struct Impossible<Ok, Error> {
|
pub struct Impossible<Ok, Error> {
|
||||||
void: Void,
|
void: Void,
|
||||||
ok: PhantomData<Ok>,
|
ok: PhantomData<Ok>,
|
||||||
|
|||||||
+11
-12
@@ -97,8 +97,8 @@
|
|||||||
//!
|
//!
|
||||||
//! [Implementing `Serialize`]: https://serde.rs/impl-serialize.html
|
//! [Implementing `Serialize`]: https://serde.rs/impl-serialize.html
|
||||||
//! [`LinkedHashMap<K, V>`]: https://docs.rs/linked-hash-map/*/linked_hash_map/struct.LinkedHashMap.html
|
//! [`LinkedHashMap<K, V>`]: https://docs.rs/linked-hash-map/*/linked_hash_map/struct.LinkedHashMap.html
|
||||||
//! [`Serialize`]: ../trait.Serialize.html
|
//! [`Serialize`]: crate::Serialize
|
||||||
//! [`Serializer`]: ../trait.Serializer.html
|
//! [`Serializer`]: crate::Serializer
|
||||||
//! [`postcard`]: https://github.com/jamesmunns/postcard
|
//! [`postcard`]: https://github.com/jamesmunns/postcard
|
||||||
//! [`linked-hash-map`]: https://crates.io/crates/linked-hash-map
|
//! [`linked-hash-map`]: https://crates.io/crates/linked-hash-map
|
||||||
//! [`serde_derive`]: https://crates.io/crates/serde_derive
|
//! [`serde_derive`]: https://crates.io/crates/serde_derive
|
||||||
@@ -173,8 +173,8 @@ macro_rules! declare_error_trait {
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [`Path`]: https://doc.rust-lang.org/std/path/struct.Path.html
|
/// [`Path`]: std::path::Path
|
||||||
/// [`Serialize`]: ../trait.Serialize.html
|
/// [`Serialize`]: crate::Serialize
|
||||||
fn custom<T>(msg: T) -> Self
|
fn custom<T>(msg: T) -> Self
|
||||||
where
|
where
|
||||||
T: Display;
|
T: Display;
|
||||||
@@ -345,7 +345,7 @@ pub trait Serializer: Sized {
|
|||||||
/// in-memory data structures may be simplified by using `Ok` to propagate
|
/// in-memory data structures may be simplified by using `Ok` to propagate
|
||||||
/// the data structure around.
|
/// the data structure around.
|
||||||
///
|
///
|
||||||
/// [`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html
|
/// [`io::Write`]: std::io::Write
|
||||||
type Ok;
|
type Ok;
|
||||||
|
|
||||||
/// The error type when some error occurs during serialization.
|
/// The error type when some error occurs during serialization.
|
||||||
@@ -769,7 +769,7 @@ pub trait Serializer: Sized {
|
|||||||
/// # fn main() {}
|
/// # fn main() {}
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [`None`]: https://doc.rust-lang.org/std/option/enum.Option.html#variant.None
|
/// [`None`]: core::option::Option::None
|
||||||
fn serialize_none(self) -> Result<Self::Ok, Self::Error>;
|
fn serialize_none(self) -> Result<Self::Ok, Self::Error>;
|
||||||
|
|
||||||
/// Serialize a [`Some(T)`] value.
|
/// Serialize a [`Some(T)`] value.
|
||||||
@@ -802,7 +802,7 @@ pub trait Serializer: Sized {
|
|||||||
/// # fn main() {}
|
/// # fn main() {}
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [`Some(T)`]: https://doc.rust-lang.org/std/option/enum.Option.html#variant.Some
|
/// [`Some(T)`]: core::option::Option::Some
|
||||||
fn serialize_some<T>(self, value: &T) -> Result<Self::Ok, Self::Error>
|
fn serialize_some<T>(self, value: &T) -> Result<Self::Ok, Self::Error>
|
||||||
where
|
where
|
||||||
T: ?Sized + Serialize;
|
T: ?Sized + Serialize;
|
||||||
@@ -1353,8 +1353,7 @@ pub trait Serializer: Sized {
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [`String`]: https://doc.rust-lang.org/std/string/struct.String.html
|
/// [`serialize_str`]: Self::serialize_str
|
||||||
/// [`serialize_str`]: #tymethod.serialize_str
|
|
||||||
#[cfg(any(feature = "std", feature = "alloc"))]
|
#[cfg(any(feature = "std", feature = "alloc"))]
|
||||||
fn collect_str<T>(self, value: &T) -> Result<Self::Ok, Self::Error>
|
fn collect_str<T>(self, value: &T) -> Result<Self::Ok, Self::Error>
|
||||||
where
|
where
|
||||||
@@ -1805,9 +1804,9 @@ pub trait SerializeMap {
|
|||||||
/// care about performance or are not able to optimize `serialize_entry` any
|
/// care about performance or are not able to optimize `serialize_entry` any
|
||||||
/// better than this.
|
/// better than this.
|
||||||
///
|
///
|
||||||
/// [`Serialize`]: ../trait.Serialize.html
|
/// [`Serialize`]: crate::Serialize
|
||||||
/// [`serialize_key`]: #tymethod.serialize_key
|
/// [`serialize_key`]: Self::serialize_key
|
||||||
/// [`serialize_value`]: #tymethod.serialize_value
|
/// [`serialize_value`]: Self::serialize_value
|
||||||
fn serialize_entry<K, V>(&mut self, key: &K, value: &V) -> Result<(), Self::Error>
|
fn serialize_entry<K, V>(&mut self, key: &K, value: &V) -> Result<(), Self::Error>
|
||||||
where
|
where
|
||||||
K: ?Sized + Serialize,
|
K: ?Sized + Serialize,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.215"
|
version = "1.0.218"
|
||||||
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)]"
|
||||||
@@ -32,4 +32,9 @@ serde = { version = "1", path = "../serde" }
|
|||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
targets = ["x86_64-unknown-linux-gnu"]
|
targets = ["x86_64-unknown-linux-gnu"]
|
||||||
rustdoc-args = ["--generate-link-to-definition"]
|
rustdoc-args = [
|
||||||
|
"--generate-link-to-definition",
|
||||||
|
"--extern-html-root-url=core=https://doc.rust-lang.org",
|
||||||
|
"--extern-html-root-url=alloc=https://doc.rust-lang.org",
|
||||||
|
"--extern-html-root-url=std=https://doc.rust-lang.org",
|
||||||
|
]
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ pub fn expand_derive_deserialize(input: &mut syn::DeriveInput) -> syn::Result<To
|
|||||||
let vis = &input.vis;
|
let vis = &input.vis;
|
||||||
let used = pretend::pretend_used(&cont, params.is_packed);
|
let used = pretend::pretend_used(&cont, params.is_packed);
|
||||||
quote! {
|
quote! {
|
||||||
|
#[automatically_derived]
|
||||||
impl #de_impl_generics #ident #ty_generics #where_clause {
|
impl #de_impl_generics #ident #ty_generics #where_clause {
|
||||||
#vis fn deserialize<__D>(__deserializer: __D) -> #serde::__private::Result<#remote #ty_generics, __D::Error>
|
#vis fn deserialize<__D>(__deserializer: __D) -> #serde::__private::Result<#remote #ty_generics, __D::Error>
|
||||||
where
|
where
|
||||||
@@ -424,6 +425,7 @@ fn deserialize_unit_struct(params: &Parameters, cattrs: &attr::Container) -> Fra
|
|||||||
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[automatically_derived]
|
||||||
impl #de_impl_generics _serde::de::Visitor<#delife> for __Visitor #de_ty_generics #where_clause {
|
impl #de_impl_generics _serde::de::Visitor<#delife> for __Visitor #de_ty_generics #where_clause {
|
||||||
type Value = #this_type #ty_generics;
|
type Value = #this_type #ty_generics;
|
||||||
|
|
||||||
@@ -559,6 +561,7 @@ fn deserialize_tuple(
|
|||||||
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[automatically_derived]
|
||||||
impl #de_impl_generics _serde::de::Visitor<#delife> for __Visitor #de_ty_generics #where_clause {
|
impl #de_impl_generics _serde::de::Visitor<#delife> for __Visitor #de_ty_generics #where_clause {
|
||||||
type Value = #this_type #ty_generics;
|
type Value = #this_type #ty_generics;
|
||||||
|
|
||||||
@@ -658,6 +661,7 @@ fn deserialize_tuple_in_place(
|
|||||||
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[automatically_derived]
|
||||||
impl #in_place_impl_generics _serde::de::Visitor<#delife> for __Visitor #in_place_ty_generics #where_clause {
|
impl #in_place_impl_generics _serde::de::Visitor<#delife> for __Visitor #in_place_ty_generics #where_clause {
|
||||||
type Value = ();
|
type Value = ();
|
||||||
|
|
||||||
@@ -1020,6 +1024,7 @@ fn deserialize_struct(
|
|||||||
|
|
||||||
let visitor_seed = match form {
|
let visitor_seed = match form {
|
||||||
StructForm::ExternallyTagged(..) if has_flatten => Some(quote! {
|
StructForm::ExternallyTagged(..) if has_flatten => Some(quote! {
|
||||||
|
#[automatically_derived]
|
||||||
impl #de_impl_generics _serde::de::DeserializeSeed<#delife> for __Visitor #de_ty_generics #where_clause {
|
impl #de_impl_generics _serde::de::DeserializeSeed<#delife> for __Visitor #de_ty_generics #where_clause {
|
||||||
type Value = #this_type #ty_generics;
|
type Value = #this_type #ty_generics;
|
||||||
|
|
||||||
@@ -1084,6 +1089,7 @@ fn deserialize_struct(
|
|||||||
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[automatically_derived]
|
||||||
impl #de_impl_generics _serde::de::Visitor<#delife> for __Visitor #de_ty_generics #where_clause {
|
impl #de_impl_generics _serde::de::Visitor<#delife> for __Visitor #de_ty_generics #where_clause {
|
||||||
type Value = #this_type #ty_generics;
|
type Value = #this_type #ty_generics;
|
||||||
|
|
||||||
@@ -1165,6 +1171,7 @@ fn deserialize_struct_in_place(
|
|||||||
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[automatically_derived]
|
||||||
impl #in_place_impl_generics _serde::de::Visitor<#delife> for __Visitor #in_place_ty_generics #where_clause {
|
impl #in_place_impl_generics _serde::de::Visitor<#delife> for __Visitor #in_place_ty_generics #where_clause {
|
||||||
type Value = ();
|
type Value = ();
|
||||||
|
|
||||||
@@ -1338,6 +1345,7 @@ fn deserialize_externally_tagged_enum(
|
|||||||
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[automatically_derived]
|
||||||
impl #de_impl_generics _serde::de::Visitor<#delife> for __Visitor #de_ty_generics #where_clause {
|
impl #de_impl_generics _serde::de::Visitor<#delife> for __Visitor #de_ty_generics #where_clause {
|
||||||
type Value = #this_type #ty_generics;
|
type Value = #this_type #ty_generics;
|
||||||
|
|
||||||
@@ -1599,6 +1607,7 @@ fn deserialize_adjacently_tagged_enum(
|
|||||||
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[automatically_derived]
|
||||||
impl #de_impl_generics _serde::de::DeserializeSeed<#delife> for __Seed #de_ty_generics #where_clause {
|
impl #de_impl_generics _serde::de::DeserializeSeed<#delife> for __Seed #de_ty_generics #where_clause {
|
||||||
type Value = #this_type #ty_generics;
|
type Value = #this_type #ty_generics;
|
||||||
|
|
||||||
@@ -1618,6 +1627,7 @@ fn deserialize_adjacently_tagged_enum(
|
|||||||
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[automatically_derived]
|
||||||
impl #de_impl_generics _serde::de::Visitor<#delife> for __Visitor #de_ty_generics #where_clause {
|
impl #de_impl_generics _serde::de::Visitor<#delife> for __Visitor #de_ty_generics #where_clause {
|
||||||
type Value = #this_type #ty_generics;
|
type Value = #this_type #ty_generics;
|
||||||
|
|
||||||
@@ -2046,12 +2056,14 @@ fn deserialize_generated_identifier(
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
struct __FieldVisitor;
|
struct __FieldVisitor;
|
||||||
|
|
||||||
|
#[automatically_derived]
|
||||||
impl<'de> _serde::de::Visitor<'de> for __FieldVisitor {
|
impl<'de> _serde::de::Visitor<'de> for __FieldVisitor {
|
||||||
type Value = __Field #lifetime;
|
type Value = __Field #lifetime;
|
||||||
|
|
||||||
#visitor_impl
|
#visitor_impl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[automatically_derived]
|
||||||
impl<'de> _serde::Deserialize<'de> for __Field #lifetime {
|
impl<'de> _serde::Deserialize<'de> for __Field #lifetime {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn deserialize<__D>(__deserializer: __D) -> _serde::__private::Result<Self, __D::Error>
|
fn deserialize<__D>(__deserializer: __D) -> _serde::__private::Result<Self, __D::Error>
|
||||||
@@ -2190,6 +2202,7 @@ fn deserialize_custom_identifier(
|
|||||||
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[automatically_derived]
|
||||||
impl #de_impl_generics _serde::de::Visitor<#delife> for __FieldVisitor #de_ty_generics #where_clause {
|
impl #de_impl_generics _serde::de::Visitor<#delife> for __FieldVisitor #de_ty_generics #where_clause {
|
||||||
type Value = #this_type #ty_generics;
|
type Value = #this_type #ty_generics;
|
||||||
|
|
||||||
@@ -2909,6 +2922,7 @@ fn wrap_deserialize_with(
|
|||||||
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
lifetime: _serde::__private::PhantomData<&#delife ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[automatically_derived]
|
||||||
impl #de_impl_generics _serde::Deserialize<#delife> for __DeserializeWith #de_ty_generics #where_clause {
|
impl #de_impl_generics _serde::Deserialize<#delife> for __DeserializeWith #de_ty_generics #where_clause {
|
||||||
fn deserialize<__D>(#deserializer_var: __D) -> _serde::__private::Result<Self, __D::Error>
|
fn deserialize<__D>(#deserializer_var: __D) -> _serde::__private::Result<Self, __D::Error>
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -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.215")]
|
#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.218")]
|
||||||
#![cfg_attr(not(check_cfg), allow(unexpected_cfgs))]
|
#![cfg_attr(not(check_cfg), allow(unexpected_cfgs))]
|
||||||
// Ignored clippy lints
|
// Ignored clippy lints
|
||||||
#![allow(
|
#![allow(
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ pub fn expand_derive_serialize(input: &mut syn::DeriveInput) -> syn::Result<Toke
|
|||||||
let vis = &input.vis;
|
let vis = &input.vis;
|
||||||
let used = pretend::pretend_used(&cont, params.is_packed);
|
let used = pretend::pretend_used(&cont, params.is_packed);
|
||||||
quote! {
|
quote! {
|
||||||
|
#[automatically_derived]
|
||||||
impl #impl_generics #ident #ty_generics #where_clause {
|
impl #impl_generics #ident #ty_generics #where_clause {
|
||||||
#vis fn serialize<__S>(__self: &#remote #ty_generics, __serializer: __S) -> #serde::__private::Result<__S::Ok, __S::Error>
|
#vis fn serialize<__S>(__self: &#remote #ty_generics, __serializer: __S) -> #serde::__private::Result<__S::Ok, __S::Error>
|
||||||
where
|
where
|
||||||
@@ -733,6 +734,7 @@ fn serialize_adjacently_tagged_variant(
|
|||||||
phantom: _serde::__private::PhantomData<#this_type #ty_generics>,
|
phantom: _serde::__private::PhantomData<#this_type #ty_generics>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[automatically_derived]
|
||||||
impl #wrapper_impl_generics _serde::Serialize for __AdjacentlyTagged #wrapper_ty_generics #where_clause {
|
impl #wrapper_impl_generics _serde::Serialize for __AdjacentlyTagged #wrapper_ty_generics #where_clause {
|
||||||
fn serialize<__S>(&self, __serializer: __S) -> _serde::__private::Result<__S::Ok, __S::Error>
|
fn serialize<__S>(&self, __serializer: __S) -> _serde::__private::Result<__S::Ok, __S::Error>
|
||||||
where
|
where
|
||||||
@@ -997,6 +999,7 @@ fn serialize_struct_variant_with_flatten(
|
|||||||
phantom: _serde::__private::PhantomData<#this_type #ty_generics>,
|
phantom: _serde::__private::PhantomData<#this_type #ty_generics>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[automatically_derived]
|
||||||
impl #wrapper_impl_generics _serde::Serialize for __EnumFlatten #wrapper_ty_generics #where_clause {
|
impl #wrapper_impl_generics _serde::Serialize for __EnumFlatten #wrapper_ty_generics #where_clause {
|
||||||
fn serialize<__S>(&self, __serializer: __S) -> _serde::__private::Result<__S::Ok, __S::Error>
|
fn serialize<__S>(&self, __serializer: __S) -> _serde::__private::Result<__S::Ok, __S::Error>
|
||||||
where
|
where
|
||||||
@@ -1239,6 +1242,7 @@ fn wrap_serialize_with(
|
|||||||
phantom: _serde::__private::PhantomData<#this_type #ty_generics>,
|
phantom: _serde::__private::PhantomData<#this_type #ty_generics>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[automatically_derived]
|
||||||
impl #wrapper_impl_generics _serde::Serialize for __SerializeWith #wrapper_ty_generics #where_clause {
|
impl #wrapper_impl_generics _serde::Serialize for __SerializeWith #wrapper_ty_generics #where_clause {
|
||||||
fn serialize<__S>(&#self_var, #serializer_var: __S) -> _serde::__private::Result<__S::Ok, __S::Error>
|
fn serialize<__S>(&#self_var, #serializer_var: __S) -> _serde::__private::Result<__S::Ok, __S::Error>
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -22,4 +22,9 @@ syn = { workspace = true, features = ["clone-impls", "derive", "parsing", "print
|
|||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
targets = ["x86_64-unknown-linux-gnu"]
|
targets = ["x86_64-unknown-linux-gnu"]
|
||||||
rustdoc-args = ["--generate-link-to-definition"]
|
rustdoc-args = [
|
||||||
|
"--generate-link-to-definition",
|
||||||
|
"--extern-html-root-url=core=https://doc.rust-lang.org",
|
||||||
|
"--extern-html-root-url=alloc=https://doc.rust-lang.org",
|
||||||
|
"--extern-html-root-url=std=https://doc.rust-lang.org",
|
||||||
|
]
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ serde = { path = "../serde" }
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
automod = "1.0.1"
|
automod = "1.0.1"
|
||||||
fnv = "1.0"
|
foldhash = "0.1"
|
||||||
rustversion = "1.0"
|
rustversion = "1.0"
|
||||||
serde = { path = "../serde", features = ["rc"] }
|
serde = { path = "../serde", features = ["rc"] }
|
||||||
serde_derive = { path = "../serde_derive", features = ["deserialize_in_place"] }
|
serde_derive = { path = "../serde_derive", features = ["deserialize_in_place"] }
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
/target/
|
||||||
|
/Cargo.lock
|
||||||
@@ -10,4 +10,10 @@ libc = { version = "0.2", default-features = false }
|
|||||||
serde = { path = "../../serde", default-features = false }
|
serde = { path = "../../serde", default-features = false }
|
||||||
serde_derive = { path = "../../serde_derive" }
|
serde_derive = { path = "../../serde_derive" }
|
||||||
|
|
||||||
|
[profile.dev]
|
||||||
|
panic = "abort"
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
panic = "abort"
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
#![allow(internal_features)]
|
|
||||||
#![feature(lang_items, start)]
|
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
#![no_main]
|
||||||
|
|
||||||
#[start]
|
use core::ffi::c_int;
|
||||||
fn start(_argc: isize, _argv: *const *const u8) -> isize {
|
|
||||||
|
#[no_mangle]
|
||||||
|
extern "C" fn main(_argc: c_int, _argv: *const *const u8) -> c_int {
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
|
|
||||||
#[lang = "eh_personality"]
|
|
||||||
#[no_mangle]
|
|
||||||
pub extern "C" fn rust_eh_personality() {}
|
|
||||||
|
|
||||||
#[panic_handler]
|
#[panic_handler]
|
||||||
fn panic(_info: &core::panic::PanicInfo) -> ! {
|
fn panic(_info: &core::panic::PanicInfo) -> ! {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|||||||
@@ -34,9 +34,8 @@ macro_rules! hashset {
|
|||||||
$(set.insert($value);)+
|
$(set.insert($value);)+
|
||||||
set
|
set
|
||||||
}};
|
}};
|
||||||
($hasher:ident @ $($value:expr),+) => {{
|
($hasher:ty; $($value:expr),+) => {{
|
||||||
use std::hash::BuildHasherDefault;
|
let mut set = HashSet::<_, $hasher>::default();
|
||||||
let mut set = HashSet::with_hasher(BuildHasherDefault::<$hasher>::default());
|
|
||||||
$(set.insert($value);)+
|
$(set.insert($value);)+
|
||||||
set
|
set
|
||||||
}};
|
}};
|
||||||
@@ -51,9 +50,8 @@ macro_rules! hashmap {
|
|||||||
$(map.insert($key, $value);)+
|
$(map.insert($key, $value);)+
|
||||||
map
|
map
|
||||||
}};
|
}};
|
||||||
($hasher:ident @ $($key:expr => $value:expr),+) => {{
|
($hasher:ty; $($key:expr => $value:expr),+) => {{
|
||||||
use std::hash::BuildHasherDefault;
|
let mut map = HashMap::<_, _, $hasher>::default();
|
||||||
let mut map = HashMap::with_hasher(BuildHasherDefault::<$hasher>::default());
|
|
||||||
$(map.insert($key, $value);)+
|
$(map.insert($key, $value);)+
|
||||||
map
|
map
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -2655,11 +2655,46 @@ mod flatten {
|
|||||||
|
|
||||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||||
enum Enum {
|
enum Enum {
|
||||||
|
Unit,
|
||||||
Newtype(HashMap<String, String>),
|
Newtype(HashMap<String, String>),
|
||||||
Tuple(u32, u32),
|
Tuple(u32, u32),
|
||||||
Struct { index: u32, value: u32 },
|
Struct { index: u32, value: u32 },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn unit() {
|
||||||
|
let value = Flatten {
|
||||||
|
data: Enum::Unit,
|
||||||
|
extra: HashMap::from_iter([("extra_key".into(), "extra value".into())]),
|
||||||
|
};
|
||||||
|
assert_tokens(
|
||||||
|
&value,
|
||||||
|
&[
|
||||||
|
Token::Map { len: None },
|
||||||
|
// data
|
||||||
|
Token::Str("Unit"), // variant
|
||||||
|
Token::Unit,
|
||||||
|
// extra
|
||||||
|
Token::Str("extra_key"),
|
||||||
|
Token::Str("extra value"),
|
||||||
|
Token::MapEnd,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
assert_de_tokens(
|
||||||
|
&value,
|
||||||
|
&[
|
||||||
|
Token::Map { len: None },
|
||||||
|
// extra
|
||||||
|
Token::Str("extra_key"),
|
||||||
|
Token::Str("extra value"),
|
||||||
|
// data
|
||||||
|
Token::Str("Unit"), // variant
|
||||||
|
Token::Unit,
|
||||||
|
Token::MapEnd,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn newtype() {
|
fn newtype() {
|
||||||
assert_tokens(
|
assert_tokens(
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
)]
|
)]
|
||||||
#![cfg_attr(feature = "unstable", feature(never_type))]
|
#![cfg_attr(feature = "unstable", feature(never_type))]
|
||||||
|
|
||||||
use fnv::FnvHasher;
|
|
||||||
use serde::de::value::{F32Deserializer, F64Deserializer};
|
use serde::de::value::{F32Deserializer, F64Deserializer};
|
||||||
use serde::de::{Deserialize, DeserializeOwned, Deserializer, IntoDeserializer};
|
use serde::de::{Deserialize, DeserializeOwned, Deserializer, IntoDeserializer};
|
||||||
use serde_derive::Deserialize;
|
use serde_derive::Deserialize;
|
||||||
@@ -1040,7 +1039,7 @@ fn test_hashset() {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
test(
|
test(
|
||||||
hashset![FnvHasher @ 1, 2, 3],
|
hashset![foldhash::fast::FixedState; 1, 2, 3],
|
||||||
&[
|
&[
|
||||||
Token::Seq { len: Some(3) },
|
Token::Seq { len: Some(3) },
|
||||||
Token::I32(1),
|
Token::I32(1),
|
||||||
@@ -1275,7 +1274,7 @@ fn test_hashmap() {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
test(
|
test(
|
||||||
hashmap![FnvHasher @ 1 => 2, 3 => 4],
|
hashmap![foldhash::fast::FixedState; 1 => 2, 3 => 4],
|
||||||
&[
|
&[
|
||||||
Token::Map { len: Some(2) },
|
Token::Map { len: Some(2) },
|
||||||
Token::I32(1),
|
Token::I32(1),
|
||||||
|
|||||||
@@ -769,7 +769,7 @@ fn test_gen() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
struct Packed {
|
struct Packed {
|
||||||
x: u8,
|
x: u8,
|
||||||
@@ -915,14 +915,14 @@ where
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
pub struct RemotePacked {
|
pub struct RemotePacked {
|
||||||
pub a: u16,
|
pub a: u16,
|
||||||
pub b: u32,
|
pub b: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
#[serde(remote = "RemotePacked")]
|
#[serde(remote = "RemotePacked")]
|
||||||
pub struct RemotePackedDef {
|
pub struct RemotePackedDef {
|
||||||
a: u16,
|
a: u16,
|
||||||
@@ -933,14 +933,14 @@ impl Drop for RemotePackedDef {
|
|||||||
fn drop(&mut self) {}
|
fn drop(&mut self) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
pub struct RemotePackedNonCopy {
|
pub struct RemotePackedNonCopy {
|
||||||
pub a: u16,
|
pub a: u16,
|
||||||
pub b: String,
|
pub b: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
#[serde(remote = "RemotePackedNonCopy")]
|
#[serde(remote = "RemotePackedNonCopy")]
|
||||||
pub struct RemotePackedNonCopyDef {
|
pub struct RemotePackedNonCopyDef {
|
||||||
a: u16,
|
a: u16,
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#![allow(clippy::derive_partial_eq_without_eq, clippy::unreadable_literal)]
|
#![allow(clippy::derive_partial_eq_without_eq, clippy::unreadable_literal)]
|
||||||
#![cfg_attr(feature = "unstable", feature(never_type))]
|
#![cfg_attr(feature = "unstable", feature(never_type))]
|
||||||
|
|
||||||
use fnv::FnvHasher;
|
|
||||||
use serde_derive::Serialize;
|
use serde_derive::Serialize;
|
||||||
use serde_test::{assert_ser_tokens, assert_ser_tokens_error, Configure, Token};
|
use serde_test::{assert_ser_tokens, assert_ser_tokens_error, Configure, Token};
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
@@ -220,7 +219,7 @@ fn test_hashset() {
|
|||||||
&[Token::Seq { len: Some(1) }, Token::I32(1), Token::SeqEnd],
|
&[Token::Seq { len: Some(1) }, Token::I32(1), Token::SeqEnd],
|
||||||
);
|
);
|
||||||
assert_ser_tokens(
|
assert_ser_tokens(
|
||||||
&hashset![FnvHasher @ 1],
|
&hashset![foldhash::fast::FixedState; 1],
|
||||||
&[Token::Seq { len: Some(1) }, Token::I32(1), Token::SeqEnd],
|
&[Token::Seq { len: Some(1) }, Token::I32(1), Token::SeqEnd],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -300,7 +299,7 @@ fn test_hashmap() {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
assert_ser_tokens(
|
assert_ser_tokens(
|
||||||
&hashmap![FnvHasher @ 1 => 2],
|
&hashmap![foldhash::fast::FixedState; 1 => 2],
|
||||||
&[
|
&[
|
||||||
Token::Map { len: Some(1) },
|
Token::Map { len: Some(1) },
|
||||||
Token::I32(1),
|
Token::I32(1),
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ error[E0609]: no field `b` on type `&remote::S`
|
|||||||
|
|
|
|
||||||
help: a field with a similar name exists
|
help: a field with a similar name exists
|
||||||
|
|
|
|
||||||
12 | a: u8,
|
12 - b: u8,
|
||||||
| ~
|
12 + a: u8,
|
||||||
|
|
|
||||||
|
|
||||||
error[E0560]: struct `remote::S` has no field named `b`
|
error[E0560]: struct `remote::S` has no field named `b`
|
||||||
--> tests/ui/remote/unknown_field.rs:12:5
|
--> tests/ui/remote/unknown_field.rs:12:5
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ note: function defined here
|
|||||||
--> tests/ui/with/incorrect_type.rs:9:12
|
--> tests/ui/with/incorrect_type.rs:9:12
|
||||||
|
|
|
|
||||||
9 | pub fn serialize<T, S: Serializer>(_: S) -> Result<S::Ok, S::Error> {
|
9 | pub fn serialize<T, S: Serializer>(_: S) -> Result<S::Ok, S::Error> {
|
||||||
| ^^^^^^^^^ ----
|
| ^^^^^^^^^
|
||||||
|
|
||||||
error[E0277]: the trait bound `&u8: Serializer` is not satisfied
|
error[E0277]: the trait bound `&u8: Serializer` is not satisfied
|
||||||
--> tests/ui/with/incorrect_type.rs:15:25
|
--> tests/ui/with/incorrect_type.rs:15:25
|
||||||
@@ -79,7 +79,7 @@ note: function defined here
|
|||||||
--> tests/ui/with/incorrect_type.rs:9:12
|
--> tests/ui/with/incorrect_type.rs:9:12
|
||||||
|
|
|
|
||||||
9 | pub fn serialize<T, S: Serializer>(_: S) -> Result<S::Ok, S::Error> {
|
9 | pub fn serialize<T, S: Serializer>(_: S) -> Result<S::Ok, S::Error> {
|
||||||
| ^^^^^^^^^ ----
|
| ^^^^^^^^^
|
||||||
|
|
||||||
error[E0277]: the trait bound `&u8: Serializer` is not satisfied
|
error[E0277]: the trait bound `&u8: Serializer` is not satisfied
|
||||||
--> tests/ui/with/incorrect_type.rs:18:35
|
--> tests/ui/with/incorrect_type.rs:18:35
|
||||||
|
|||||||
Reference in New Issue
Block a user