mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-22 22:58:02 +00:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d17902059e | |||
| a27948e209 | |||
| 576e2ef9d8 | |||
| dd0eb0f2ca | |||
| f7fc3e0d67 | |||
| 1c396d223b | |||
| e42684f9a7 | |||
| 56c29b3c5d | |||
| 5a44519a9a | |||
| fae23fea97 | |||
| d656b4dd6a | |||
| b517ec9fd7 | |||
| 086353c581 | |||
| 4e278703c6 | |||
| 9f9a1ea35e |
+14
-14
@@ -18,10 +18,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
- uses: dtolnay/rust-toolchain@nightly
|
||||
- run: cd test_suite && cargo test --features unstable
|
||||
- uses: actions/upload-artifact@v4
|
||||
- uses: actions/upload-artifact@v6
|
||||
if: always()
|
||||
with:
|
||||
name: Cargo.lock
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
- uses: dtolnay/rust-toolchain@nightly
|
||||
- run: cd test_suite && cargo test --features unstable -- --skip ui --exact
|
||||
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
rust: [stable, beta]
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
- uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: ${{matrix.rust}}
|
||||
@@ -63,7 +63,7 @@ jobs:
|
||||
os: [ubuntu, windows]
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
- uses: dtolnay/rust-toolchain@nightly
|
||||
- run: cd serde && cargo build
|
||||
- run: cd serde && cargo build --no-default-features
|
||||
@@ -87,7 +87,7 @@ jobs:
|
||||
rust: [1.56.0, 1.60.0]
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
- uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: ${{matrix.rust}}
|
||||
@@ -98,12 +98,12 @@ jobs:
|
||||
- run: cd serde && cargo build
|
||||
|
||||
derive:
|
||||
name: Rust 1.61.0
|
||||
name: Rust 1.68.0
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@1.61.0
|
||||
- uses: actions/checkout@v6
|
||||
- uses: dtolnay/rust-toolchain@1.68.0
|
||||
- run: |
|
||||
sed -i 's/proc-macro2 = { workspace = true/proc-macro2 = { version = "1"/' serde_derive*/Cargo.toml
|
||||
sed -i 's/quote = { workspace = true/quote = { version = "1"/' serde_derive*/Cargo.toml
|
||||
@@ -117,7 +117,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
- uses: dtolnay/rust-toolchain@nightly
|
||||
- run: cargo generate-lockfile -Z minimal-versions
|
||||
- run: cargo check --locked --workspace
|
||||
@@ -129,7 +129,7 @@ jobs:
|
||||
env:
|
||||
RUSTDOCFLAGS: -Dwarnings
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
- uses: dtolnay/rust-toolchain@nightly
|
||||
- uses: dtolnay/install@cargo-docs-rs
|
||||
- run: cargo docs-rs -p serde
|
||||
@@ -143,7 +143,7 @@ jobs:
|
||||
if: github.event_name != 'pull_request'
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
- uses: dtolnay/rust-toolchain@clippy
|
||||
- run: cd serde && cargo clippy --features rc,unstable -- -Dclippy::all -Dclippy::pedantic
|
||||
- run: cd serde_core && cargo clippy --features rc,unstable -- -Dclippy::all -Dclippy::pedantic
|
||||
@@ -157,7 +157,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
- uses: dtolnay/rust-toolchain@miri
|
||||
with:
|
||||
toolchain: nightly-2025-05-16 # https://github.com/rust-lang/miri/issues/4323
|
||||
@@ -175,7 +175,7 @@ jobs:
|
||||
if: github.event_name != 'pull_request'
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: dtolnay/install@cargo-outdated
|
||||
- run: cargo outdated --workspace --exit-code 1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde msrv]][Rust 1.56] [![serde_derive msrv]][Rust 1.61]
|
||||
# Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde msrv]][Rust 1.56] [![serde_derive msrv]][Rust 1.68]
|
||||
|
||||
[Build Status]: https://img.shields.io/github/actions/workflow/status/serde-rs/serde/ci.yml?branch=master
|
||||
[actions]: https://github.com/serde-rs/serde/actions?query=branch%3Amaster
|
||||
@@ -6,8 +6,8 @@
|
||||
[crates.io]: https://crates.io/crates/serde
|
||||
[serde msrv]: https://img.shields.io/crates/msrv/serde.svg?label=serde%20msrv&color=lightgray
|
||||
[serde_derive msrv]: https://img.shields.io/crates/msrv/serde_derive.svg?label=serde_derive%20msrv&color=lightgray
|
||||
[Rust 1.56]: https://blog.rust-lang.org/2021/10/21/Rust-1.56.0.html
|
||||
[Rust 1.61]: https://blog.rust-lang.org/2022/05/19/Rust-1.61.0.html
|
||||
[Rust 1.56]: https://blog.rust-lang.org/2021/10/21/Rust-1.56.0/
|
||||
[Rust 1.68]: https://blog.rust-lang.org/2023/03/09/Rust-1.68.0/
|
||||
|
||||
**Serde is a framework for *ser*ializing and *de*serializing Rust data structures efficiently and generically.**
|
||||
|
||||
|
||||
+2
-2
@@ -45,8 +45,8 @@ fn main() {
|
||||
println!("cargo:rustc-check-cfg=cfg(no_target_has_atomic)");
|
||||
}
|
||||
|
||||
// Current minimum supported version of serde_derive crate is Rust 1.61.
|
||||
if minor < 61 {
|
||||
// Current minimum supported version of serde_derive crate is Rust 1.68.
|
||||
if minor < 68 {
|
||||
println!("cargo:rustc-cfg=no_serde_derive");
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -119,7 +119,7 @@
|
||||
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/7768
|
||||
clippy::semicolon_if_nothing_returned,
|
||||
// not available in our oldest supported compiler
|
||||
clippy::empty_enum,
|
||||
clippy::empty_enums,
|
||||
clippy::type_repetition_in_bounds, // https://github.com/rust-lang/rust-clippy/issues/8772
|
||||
// integer and float ser/de requires these sorts of casts
|
||||
clippy::cast_possible_truncation,
|
||||
|
||||
+5
-5
@@ -65,17 +65,17 @@ fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
// Current minimum supported version of serde_derive crate is Rust 1.61.
|
||||
if minor < 61 {
|
||||
println!("cargo:rustc-cfg=no_serde_derive");
|
||||
}
|
||||
|
||||
// Support for core::ffi::CStr and alloc::ffi::CString stabilized in Rust 1.64.
|
||||
// https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html#c-compatible-ffi-types-in-core-and-alloc
|
||||
if minor < 64 {
|
||||
println!("cargo:rustc-cfg=no_core_cstr");
|
||||
}
|
||||
|
||||
// Current minimum supported version of serde_derive crate is Rust 1.68.
|
||||
if minor < 68 {
|
||||
println!("cargo:rustc-cfg=no_serde_derive");
|
||||
}
|
||||
|
||||
// Support for core::num::Saturating and std::num::Saturating stabilized in Rust 1.74
|
||||
// https://blog.rust-lang.org/2023/11/16/Rust-1.74.0.html#stabilized-apis
|
||||
if minor < 74 {
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/7768
|
||||
clippy::semicolon_if_nothing_returned,
|
||||
// not available in our oldest supported compiler
|
||||
clippy::empty_enum,
|
||||
clippy::empty_enums,
|
||||
clippy::type_repetition_in_bounds, // https://github.com/rust-lang/rust-clippy/issues/8772
|
||||
// integer and float ser/de requires these sorts of casts
|
||||
clippy::cast_possible_truncation,
|
||||
|
||||
@@ -12,7 +12,7 @@ keywords = ["serde", "serialization", "no_std", "derive"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
readme = "crates-io.md"
|
||||
repository = "https://github.com/serde-rs/serde"
|
||||
rust-version = "1.61"
|
||||
rust-version = "1.68"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
||||
@@ -26,9 +26,9 @@ pub fn expand_derive_deserialize(input: &mut syn::DeriveInput) -> syn::Result<To
|
||||
replace_receiver(input);
|
||||
|
||||
let ctxt = Ctxt::new();
|
||||
let cont = match Container::from_ast(&ctxt, input, Derive::Deserialize, &private.ident()) {
|
||||
Some(cont) => cont,
|
||||
None => return Err(ctxt.check().unwrap_err()),
|
||||
let Some(cont) = Container::from_ast(&ctxt, input, Derive::Deserialize, &private.ident())
|
||||
else {
|
||||
return Err(ctxt.check().unwrap_err());
|
||||
};
|
||||
precondition(&ctxt, &cont);
|
||||
ctxt.check()?;
|
||||
@@ -594,13 +594,16 @@ fn deserialize_seq_in_place(
|
||||
let (wrapper, wrapper_ty) = wrap_deserialize_field_with(params, field.ty, path);
|
||||
quote!({
|
||||
#wrapper
|
||||
match _serde::de::SeqAccess::next_element::<#wrapper_ty>(&mut __seq)? {
|
||||
_serde::#private::Some(__wrap) => {
|
||||
match _serde::de::SeqAccess::next_element::<#wrapper_ty>(&mut __seq) {
|
||||
_serde::#private::Ok(_serde::#private::Some(__wrap)) => {
|
||||
self.place.#member = __wrap.value;
|
||||
}
|
||||
_serde::#private::None => {
|
||||
_serde::#private::Ok(_serde::#private::None) => {
|
||||
#value_if_none;
|
||||
}
|
||||
_serde::#private::Err(__err) => {
|
||||
return _serde::#private::Err(__err);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -282,8 +282,8 @@ pub(super) fn deserialize(
|
||||
__A: _serde::de::SeqAccess<#delife>,
|
||||
{
|
||||
// Visit the first element - the tag.
|
||||
match _serde::de::SeqAccess::next_element(&mut __seq)? {
|
||||
_serde::#private::Some(__variant) => {
|
||||
match _serde::de::SeqAccess::next_element(&mut __seq) {
|
||||
_serde::#private::Ok(_serde::#private::Some(__variant)) => {
|
||||
// Visit the second element - the content.
|
||||
match _serde::de::SeqAccess::next_element_seed(
|
||||
&mut __seq,
|
||||
@@ -292,18 +292,20 @@ pub(super) fn deserialize(
|
||||
marker: _serde::#private::PhantomData,
|
||||
lifetime: _serde::#private::PhantomData,
|
||||
},
|
||||
)? {
|
||||
_serde::#private::Some(__ret) => _serde::#private::Ok(__ret),
|
||||
) {
|
||||
_serde::#private::Ok(_serde::#private::Some(__ret)) => _serde::#private::Ok(__ret),
|
||||
// There is no second element.
|
||||
_serde::#private::None => {
|
||||
_serde::#private::Ok(_serde::#private::None) => {
|
||||
_serde::#private::Err(_serde::de::Error::invalid_length(1, &self))
|
||||
}
|
||||
_serde::#private::Err(__err) => _serde::#private::Err(__err),
|
||||
}
|
||||
}
|
||||
// There is no first element.
|
||||
_serde::#private::None => {
|
||||
_serde::#private::Ok(_serde::#private::None) => {
|
||||
_serde::#private::Err(_serde::de::Error::invalid_length(0, &self))
|
||||
}
|
||||
_serde::#private::Err(__err) => _serde::#private::Err(__err),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ pub(super) fn deserialize(
|
||||
));
|
||||
|
||||
quote! {
|
||||
(__Field::#variant_name, __variant) => #block
|
||||
_serde::#private::Ok((__Field::#variant_name, __variant)) => #block
|
||||
}
|
||||
});
|
||||
|
||||
@@ -69,8 +69,9 @@ pub(super) fn deserialize(
|
||||
}
|
||||
} else {
|
||||
quote! {
|
||||
match _serde::de::EnumAccess::variant(__data)? {
|
||||
match _serde::de::EnumAccess::variant(__data) {
|
||||
#(#variant_arms)*
|
||||
_serde::#private::Err(__err) => _serde::#private::Err(__err),
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1185,13 +1185,11 @@ impl Field {
|
||||
}
|
||||
}
|
||||
|
||||
// Is skip_deserializing, initialize the field to Default::default() unless a
|
||||
// If skip_deserializing, initialize the field to Default::default() unless a
|
||||
// different default is specified by `#[serde(default = "...")]` on
|
||||
// ourselves or our container (e.g. the struct we are in).
|
||||
if let Default::None = *container_default {
|
||||
if skip_deserializing.0.value.is_some() {
|
||||
default.set_if_none(Default::Default);
|
||||
}
|
||||
if container_default.is_none() && skip_deserializing.0.value.is_some() {
|
||||
default.set_if_none(Default::Default);
|
||||
}
|
||||
|
||||
let mut borrowed_lifetimes = borrowed_lifetimes.get().unwrap_or_default();
|
||||
@@ -1459,9 +1457,8 @@ fn parse_lit_into_path(
|
||||
attr_name: Symbol,
|
||||
meta: &ParseNestedMeta,
|
||||
) -> syn::Result<Option<syn::Path>> {
|
||||
let string = match get_lit_str(cx, attr_name, meta)? {
|
||||
Some(string) => string,
|
||||
None => return Ok(None),
|
||||
let Some(string) = get_lit_str(cx, attr_name, meta)? else {
|
||||
return Ok(None);
|
||||
};
|
||||
|
||||
Ok(match string.parse() {
|
||||
@@ -1481,9 +1478,8 @@ fn parse_lit_into_expr_path(
|
||||
attr_name: Symbol,
|
||||
meta: &ParseNestedMeta,
|
||||
) -> syn::Result<Option<syn::ExprPath>> {
|
||||
let string = match get_lit_str(cx, attr_name, meta)? {
|
||||
Some(string) => string,
|
||||
None => return Ok(None),
|
||||
let Some(string) = get_lit_str(cx, attr_name, meta)? else {
|
||||
return Ok(None);
|
||||
};
|
||||
|
||||
Ok(match string.parse() {
|
||||
@@ -1504,9 +1500,8 @@ fn parse_lit_into_where(
|
||||
meta_item_name: Symbol,
|
||||
meta: &ParseNestedMeta,
|
||||
) -> syn::Result<Vec<syn::WherePredicate>> {
|
||||
let string = match get_lit_str2(cx, attr_name, meta_item_name, meta)? {
|
||||
Some(string) => string,
|
||||
None => return Ok(Vec::new()),
|
||||
let Some(string) = get_lit_str2(cx, attr_name, meta_item_name, meta)? else {
|
||||
return Ok(Vec::new());
|
||||
};
|
||||
|
||||
Ok(
|
||||
@@ -1525,9 +1520,8 @@ fn parse_lit_into_ty(
|
||||
attr_name: Symbol,
|
||||
meta: &ParseNestedMeta,
|
||||
) -> syn::Result<Option<syn::Type>> {
|
||||
let string = match get_lit_str(cx, attr_name, meta)? {
|
||||
Some(string) => string,
|
||||
None => return Ok(None),
|
||||
let Some(string) = get_lit_str(cx, attr_name, meta)? else {
|
||||
return Ok(None);
|
||||
};
|
||||
|
||||
Ok(match string.parse() {
|
||||
@@ -1548,9 +1542,8 @@ fn parse_lit_into_lifetimes(
|
||||
cx: &Ctxt,
|
||||
meta: &ParseNestedMeta,
|
||||
) -> syn::Result<BTreeSet<syn::Lifetime>> {
|
||||
let string = match get_lit_str(cx, BORROW, meta)? {
|
||||
Some(string) => string,
|
||||
None => return Ok(BTreeSet::new()),
|
||||
let Some(string) = get_lit_str(cx, BORROW, meta)? else {
|
||||
return Ok(BTreeSet::new());
|
||||
};
|
||||
|
||||
if let Ok(lifetimes) = string.parse_with(|input: ParseStream| {
|
||||
@@ -1620,11 +1613,8 @@ fn is_cow(ty: &syn::Type, elem: fn(&syn::Type) -> bool) -> bool {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
let seg = match path.segments.last() {
|
||||
Some(seg) => seg,
|
||||
None => {
|
||||
return false;
|
||||
}
|
||||
let Some(seg) = path.segments.last() else {
|
||||
return false;
|
||||
};
|
||||
let args = match &seg.arguments {
|
||||
syn::PathArguments::AngleBracketed(bracketed) => &bracketed.args,
|
||||
@@ -1647,11 +1637,8 @@ fn is_option(ty: &syn::Type, elem: fn(&syn::Type) -> bool) -> bool {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
let seg = match path.segments.last() {
|
||||
Some(seg) => seg,
|
||||
None => {
|
||||
return false;
|
||||
}
|
||||
let Some(seg) = path.segments.last() else {
|
||||
return false;
|
||||
};
|
||||
let args = match &seg.arguments {
|
||||
syn::PathArguments::AngleBracketed(bracketed) => &bracketed.args,
|
||||
|
||||
@@ -46,9 +46,8 @@ impl Ctxt {
|
||||
pub fn check(self) -> syn::Result<()> {
|
||||
let mut errors = self.errors.borrow_mut().take().unwrap().into_iter();
|
||||
|
||||
let mut combined = match errors.next() {
|
||||
Some(first) => first,
|
||||
None => return Ok(()),
|
||||
let Some(mut combined) = errors.next() else {
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
for rest in errors {
|
||||
|
||||
@@ -13,9 +13,8 @@ pub fn expand_derive_serialize(input: &mut syn::DeriveInput) -> syn::Result<Toke
|
||||
replace_receiver(input);
|
||||
|
||||
let ctxt = Ctxt::new();
|
||||
let cont = match Container::from_ast(&ctxt, input, Derive::Serialize, &private.ident()) {
|
||||
Some(cont) => cont,
|
||||
None => return Err(ctxt.check().unwrap_err()),
|
||||
let Some(cont) = Container::from_ast(&ctxt, input, Derive::Serialize, &private.ident()) else {
|
||||
return Err(ctxt.check().unwrap_err());
|
||||
};
|
||||
precondition(&ctxt, &cont);
|
||||
ctxt.check()?;
|
||||
|
||||
@@ -10,7 +10,7 @@ homepage = "https://serde.rs"
|
||||
keywords = ["serde", "serialization"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
repository = "https://github.com/serde-rs/serde"
|
||||
rust-version = "1.61"
|
||||
rust-version = "1.68"
|
||||
|
||||
[lib]
|
||||
path = "lib.rs"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
clippy::cast_lossless,
|
||||
clippy::decimal_literal_representation,
|
||||
clippy::derive_partial_eq_without_eq,
|
||||
clippy::empty_enum,
|
||||
clippy::empty_enums,
|
||||
clippy::manual_assert,
|
||||
clippy::needless_pass_by_value,
|
||||
clippy::uninlined_format_args,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#![allow(
|
||||
clippy::derive_partial_eq_without_eq,
|
||||
clippy::empty_enum,
|
||||
clippy::empty_enums,
|
||||
clippy::unreadable_literal
|
||||
)]
|
||||
#![cfg_attr(feature = "unstable", feature(never_type))]
|
||||
|
||||
@@ -11,7 +11,7 @@ struct T0(u8, u8);
|
||||
struct T1(u8, #[serde(default)] u8);
|
||||
|
||||
// ERROR: The first field can get default value only if sequence is empty, but
|
||||
// that mean that all other fields cannot be deserialized without errors.
|
||||
// that means that all other fields cannot be deserialized without errors.
|
||||
#[derive(Deserialize)]
|
||||
struct T2(#[serde(default)] u8, u8, u8);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ fn d<T>() -> T {
|
||||
struct T1(u8, #[serde(default = "d")] u8);
|
||||
|
||||
// ERROR: The first field can get default value only if sequence is empty, but
|
||||
// that mean that all other fields cannot be deserialized without errors.
|
||||
// that means that all other fields cannot be deserialized without errors.
|
||||
#[derive(Deserialize)]
|
||||
struct T2(#[serde(default = "d")] u8, u8, u8);
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@ error[E0277]: the trait bound `&u8: serde::Serializer` is not satisfied
|
||||
15 | struct W(#[serde(with = "w")] u8, u8);
|
||||
| --- required by a bound introduced by this call
|
||||
|
|
||||
= help: the trait `Serializer` is implemented for `&mut Formatter<'a>`
|
||||
help: the trait `Serializer` is implemented for `&mut Formatter<'a>`
|
||||
--> $WORKSPACE/serde_core/src/ser/fmt.rs
|
||||
|
|
||||
| impl<'a> Serializer for &mut fmt::Formatter<'a> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: required by a bound in `w::serialize`
|
||||
--> tests/ui/with/incorrect_type.rs:9:28
|
||||
|
|
||||
@@ -33,7 +37,11 @@ error[E0277]: the trait bound `&u8: serde::Serializer` is not satisfied
|
||||
15 | struct W(#[serde(with = "w")] u8, u8);
|
||||
| ^^^ the trait `Serializer` is not implemented for `&u8`
|
||||
|
|
||||
= help: the trait `Serializer` is implemented for `&mut Formatter<'a>`
|
||||
help: the trait `Serializer` is implemented for `&mut Formatter<'a>`
|
||||
--> $WORKSPACE/serde_core/src/ser/fmt.rs
|
||||
|
|
||||
| impl<'a> Serializer for &mut fmt::Formatter<'a> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0308]: `?` operator has incompatible types
|
||||
--> tests/ui/with/incorrect_type.rs:15:25
|
||||
@@ -51,7 +59,11 @@ error[E0277]: the trait bound `&u8: serde::Serializer` is not satisfied
|
||||
18 | struct S(#[serde(serialize_with = "w::serialize")] u8, u8);
|
||||
| -------------- required by a bound introduced by this call
|
||||
|
|
||||
= help: the trait `Serializer` is implemented for `&mut Formatter<'a>`
|
||||
help: the trait `Serializer` is implemented for `&mut Formatter<'a>`
|
||||
--> $WORKSPACE/serde_core/src/ser/fmt.rs
|
||||
|
|
||||
| impl<'a> Serializer for &mut fmt::Formatter<'a> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: required by a bound in `w::serialize`
|
||||
--> tests/ui/with/incorrect_type.rs:9:28
|
||||
|
|
||||
@@ -78,7 +90,11 @@ error[E0277]: the trait bound `&u8: serde::Serializer` is not satisfied
|
||||
18 | struct S(#[serde(serialize_with = "w::serialize")] u8, u8);
|
||||
| ^^^^^^^^^^^^^^ the trait `Serializer` is not implemented for `&u8`
|
||||
|
|
||||
= help: the trait `Serializer` is implemented for `&mut Formatter<'a>`
|
||||
help: the trait `Serializer` is implemented for `&mut Formatter<'a>`
|
||||
--> $WORKSPACE/serde_core/src/ser/fmt.rs
|
||||
|
|
||||
| impl<'a> Serializer for &mut fmt::Formatter<'a> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0308]: `?` operator has incompatible types
|
||||
--> tests/ui/with/incorrect_type.rs:21:37
|
||||
|
||||
Reference in New Issue
Block a user