warning: unexpected `cfg` condition name: `serde_build_from_git`
--> serde_derive_internals/lib.rs:45:12
|
45 | #[cfg_attr(serde_build_from_git, path = "../serde_derive/src/internals/mod.rs")]
| ^^^^^^^^^^^^^^^^^^^^
|
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, `windows`
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(serde_build_from_git)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
= note: `#[warn(unexpected_cfgs)]` on by default
warning: unexpected `cfg` condition name: `serde_build_from_git`
--> serde_derive_internals/lib.rs:46:16
|
46 | #[cfg_attr(not(serde_build_from_git), path = "src/mod.rs")]
| ^^^^^^^^^^^^^^^^^^^^
|
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(serde_build_from_git)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `deserialize_in_place`
--> serde_derive_internals/src/attr.rs:276:11
|
276 | #[cfg(feature = "deserialize_in_place")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the condition
|
= note: no expected values for `feature`
= help: consider adding `deserialize_in_place` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
warning: unexpected `cfg` condition name: `exhaustive`
--> serde_derive_internals/src/attr.rs:1797:31
|
1797 | #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
| ^^^^^^^^^^
|
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(exhaustive)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
warning: unexpected `cfg` condition name: `exhaustive`
--> serde_derive_internals/src/receiver.rs:110:35
|
110 | #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
| ^^^^^^^^^^
|
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(exhaustive)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
warning: unexpected `cfg` condition name: `exhaustive`
--> serde_derive_internals/src/receiver.rs:181:47
|
181 | #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
| ^^^^^^^^^^
|
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(exhaustive)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
warning: unexpected `cfg` condition name: `exhaustive`
--> serde_derive_internals/src/receiver.rs:210:35
|
210 | #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
| ^^^^^^^^^^
|
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(exhaustive)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
warning: unexpected `cfg` condition name: `exhaustive`
--> serde_derive_internals/src/receiver.rs:231:43
|
231 | #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
| ^^^^^^^^^^
|
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(exhaustive)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
warning: unexpected `cfg` condition name: `exhaustive`
--> serde_derive/src/lib.rs:62:23
|
62 | #![cfg_attr(all(test, exhaustive), feature(non_exhaustive_omitted_patterns_lint))]
| ^^^^^^^^^^
|
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, `windows`
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(exhaustive)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
= note: `#[warn(unexpected_cfgs)]` on by default
warning: unexpected `cfg` condition name: `exhaustive`
--> serde_derive/src/internals/attr.rs:1797:31
|
1797 | #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
| ^^^^^^^^^^
|
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(exhaustive)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
warning: unexpected `cfg` condition name: `exhaustive`
--> serde_derive/src/internals/receiver.rs:110:35
|
110 | #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
| ^^^^^^^^^^
|
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(exhaustive)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
warning: unexpected `cfg` condition name: `exhaustive`
--> serde_derive/src/internals/receiver.rs:181:47
|
181 | #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
| ^^^^^^^^^^
|
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(exhaustive)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
warning: unexpected `cfg` condition name: `exhaustive`
--> serde_derive/src/internals/receiver.rs:210:35
|
210 | #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
| ^^^^^^^^^^
|
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(exhaustive)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
warning: unexpected `cfg` condition name: `exhaustive`
--> serde_derive/src/internals/receiver.rs:231:43
|
231 | #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
| ^^^^^^^^^^
|
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(exhaustive)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
warning: unexpected `cfg` condition name: `exhaustive`
--> serde_derive/src/bound.rs:147:39
|
147 | #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
| ^^^^^^^^^^
|
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(exhaustive)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
warning: unexpected `cfg` condition name: `exhaustive`
--> serde_derive/src/bound.rs:199:51
|
199 | ... #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
| ^^^^^^^^^^
|
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(exhaustive)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
warning: unexpected `cfg` condition name: `exhaustive`
--> serde_derive/src/bound.rs:228:39
|
228 | #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
| ^^^^^^^^^^
|
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(exhaustive)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
warning: unexpected `cfg` condition name: `systemtime_checked_add`
--> test_suite/tests/test_de_error.rs:1527:7
|
1527 | #[cfg(systemtime_checked_add)]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, `windows`
= help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(systemtime_checked_add)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
= note: `#[warn(unexpected_cfgs)]` on by default
bef110b92a changed the display for unexpected floats to always append a
".0" if there was no decimal point found in the formatting of the float.
However, this should only be relevant for finite (i.e., not NaN or inf)
values. The change introduced a test failure in the ordered-float
crate due to this:
---- impl_serde::test_fail_on_nan stdout ----
thread 'impl_serde::test_fail_on_nan' panicked at 'assertion failed: `(left == right)`
left: `Error { msg: "invalid value: floating point `NaN.0`, expected float (but not NaN)" }`,
right: `"invalid value: floating point `NaN`, expected float (but not NaN)"`', src/lib.rs:1554:9
stack backtrace:
0: rust_begin_unwind
at /usr/src/rustc-1.70.0/library/std/src/panicking.rs:578:5
1: core::panicking::panic_fmt
at /usr/src/rustc-1.70.0/library/core/src/panicking.rs:67:14
2: core::panicking::assert_failed_inner
3: core::panicking::assert_failed
at /usr/src/rustc-1.70.0/library/core/src/panicking.rs:228:5
4: serde_test::assert::assert_de_tokens_error
at /usr/share/cargo/registry/serde_test-1.0.171/src/assert.rs:228:19
5: ordered_float::impl_serde::test_fail_on_nan
at ./src/lib.rs:1554:9
6: ordered_float::impl_serde::test_fail_on_nan::{{closure}}
at ./src/lib.rs:1553:27
7: core::ops::function::FnOnce::call_once
at /usr/src/rustc-1.70.0/library/core/src/ops/function.rs:250:5
8: core::ops::function::FnOnce::call_once
at /usr/src/rustc-1.70.0/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
The serialization implementation is heavily
inspired by the existing trait implentation for
`std::num::Wrapping<T>`.
The deserializing implementation maps input values
that lie outside of the numerical range of the
output type to the `MIN` or `MAX` value of the
output type, depending on the sign of the input
value. This behaviour follows to the `Saturating`
semantics of the output type.
fix#2708
warning: usage of a legacy numeric method
--> serde_derive/src/ser.rs:292:51
|
292 | assert!(fields.len() as u64 <= u64::from(u32::max_value()));
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
= note: `#[warn(clippy::legacy_numeric_constants)]` on by default
help: use the associated constant instead
|
292 | assert!(fields.len() as u64 <= u64::from(u32::MAX));
| ~~~
warning: usage of a legacy numeric method
--> serde_derive/src/ser.rs:400:53
|
400 | assert!(variants.len() as u64 <= u64::from(u32::max_value()));
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
400 | assert!(variants.len() as u64 <= u64::from(u32::MAX));
| ~~~
warning: usage of a legacy numeric method
--> test_suite/tests/test_de_error.rs:1462:29
|
1462 | Token::U64(u64::max_value()),
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
= note: `-W clippy::legacy-numeric-constants` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::legacy_numeric_constants)]`
help: use the associated constant instead
|
1462 | Token::U64(u64::MAX),
| ~~~
warning: usage of a legacy numeric method
--> test_suite/tests/test_de_error.rs:1479:29
|
1479 | Token::U64(u64::max_value()),
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
1479 | Token::U64(u64::MAX),
| ~~~
warning: usage of a legacy numeric method
--> test_suite/tests/test_de_error.rs:1493:29
|
1493 | Token::U64(u64::max_value()),
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
1493 | Token::U64(u64::MAX),
| ~~~
warning: usage of a legacy numeric method
--> test_suite/tests/test_de_error.rs:1510:29
|
1510 | Token::U64(u64::max_value()),
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
1510 | Token::U64(u64::MAX),
| ~~~
New in nightly-2024-03-24 from https://github.com/rust-lang/rust/pull/119552.
warning: fields `nested` and `string` are never read
--> test_suite/tests/regression/issue2371.rs:10:9
|
8 | Flatten {
| ------- fields in this variant
9 | #[serde(flatten)]
10 | nested: Nested,
| ^^^^^^
11 | string: &'static str,
| ^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: fields `nested` and `string` are never read
--> test_suite/tests/regression/issue2371.rs:20:9
|
18 | Flatten {
| ------- fields in this variant
19 | #[serde(flatten)]
20 | nested: Nested,
| ^^^^^^
21 | string: &'static str,
| ^^^^^^
warning: fields `nested` and `string` are never read
--> test_suite/tests/regression/issue2371.rs:30:9
|
28 | Flatten {
| ------- fields in this variant
29 | #[serde(flatten)]
30 | nested: Nested,
| ^^^^^^
31 | string: &'static str,
| ^^^^^^
warning: fields `nested` and `string` are never read
--> test_suite/tests/regression/issue2371.rs:40:9
|
38 | Flatten {
| ------- fields in this variant
39 | #[serde(flatten)]
40 | nested: Nested,
| ^^^^^^
41 | string: &'static str,
| ^^^^^^
warning: field `0` is never read
--> test_suite/tests/test_gen.rs:690:33
|
690 | Single(#[serde(borrow)] RelObject<'a>),
| ------ ^^^^^^^^^^^^^
| |
| field in this variant
|
= note: `#[warn(dead_code)]` on by default
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
690 | Single(#[serde(borrow)] ()),
| ~~
warning: field `0` is never read
--> test_suite/tests/test_gen.rs:691:31
|
691 | Many(#[serde(borrow)] Vec<RelObject<'a>>),
| ---- ^^^^^^^^^^^^^^^^^^
| |
| field in this variant
|
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
691 | Many(#[serde(borrow)] ()),
| ~~
error: field `0` is never read
--> test_suite/tests/test_gen.rs:690:33
|
690 | Single(#[serde(borrow)] RelObject<'a>),
| ------ ^^^^^^^^^^^^^
| |
| field in this variant
|
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
690 | Single(#[serde(borrow)] ()),
| ~~
error: field `0` is never read
--> test_suite/tests/test_gen.rs:691:31
|
691 | Many(#[serde(borrow)] Vec<RelObject<'a>>),
| ---- ^^^^^^^^^^^^^^^^^^
| |
| field in this variant
|
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
691 | Many(#[serde(borrow)] ()),
| ~~
warning: unnecessary hashes around raw string literal
--> test_suite/tests/test_annotations.rs:2722:9
|
2722 | r#"invalid type: unit value, expected variant identifier"#,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
= note: `-W clippy::needless-raw-string-hashes` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::needless_raw_string_hashes)]`
help: remove all the hashes around the literal
|
2722 - r#"invalid type: unit value, expected variant identifier"#,
2722 + r"invalid type: unit value, expected variant identifier",
|
warning: unnecessary hashes around raw string literal
--> test_suite/tests/test_annotations.rs:2743:9
|
2743 | r#"invalid type: unit value, expected variant identifier"#,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
help: remove all the hashes around the literal
|
2743 - r#"invalid type: unit value, expected variant identifier"#,
2743 + r"invalid type: unit value, expected variant identifier",
|
warning: unnecessary hashes around raw string literal
--> test_suite/tests/test_annotations.rs:2769:9
|
2769 | r#"invalid type: unit value, expected variant of enum Enum"#,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
help: remove all the hashes around the literal
|
2769 - r#"invalid type: unit value, expected variant of enum Enum"#,
2769 + r"invalid type: unit value, expected variant of enum Enum",
|
warning: unnecessary hashes around raw string literal
--> test_suite/tests/test_annotations.rs:2782:63
|
2782 | assert_de_tokens_error::<Enum>(&[Token::Str("Untagged")], r#"something strange..."#);
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
help: remove all the hashes around the literal
|
2782 - assert_de_tokens_error::<Enum>(&[Token::Str("Untagged")], r#"something strange..."#);
2782 + assert_de_tokens_error::<Enum>(&[Token::Str("Untagged")], r"something strange...");
|
warning: unnecessary hashes around raw string literal
--> test_suite/tests/test_annotations.rs:2803:9
|
2803 | r#"invalid type: unit value, expected something strange..."#,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
help: remove all the hashes around the literal
|
2803 - r#"invalid type: unit value, expected something strange..."#,
2803 + r"invalid type: unit value, expected something strange...",
|
warning: unnecessary hashes around raw string literal
--> test_suite/tests/test_annotations.rs:2812:9
|
2812 | r#"invalid type: map, expected something strange..."#,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
help: remove all the hashes around the literal
|
2812 - r#"invalid type: map, expected something strange..."#,
2812 + r"invalid type: map, expected something strange...",
|
warning: unnecessary hashes around raw string literal
--> test_suite/tests/test_annotations.rs:2817:9
|
2817 | r#"invalid type: unit value, expected something strange..."#,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
help: remove all the hashes around the literal
|
2817 - r#"invalid type: unit value, expected something strange..."#,
2817 + r"invalid type: unit value, expected something strange...",
|
warning: unnecessary hashes around raw string literal
--> test_suite/tests/test_annotations.rs:2828:9
|
2828 | r#"invalid type: map, expected something strange..."#,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
help: remove all the hashes around the literal
|
2828 - r#"invalid type: map, expected something strange..."#,
2828 + r"invalid type: map, expected something strange...",
|
error[E0507]: cannot move out of `*__self` which is behind a shared reference
--> test_suite/tests/test_remote.rs:210:10
|
210 | #[derive(Serialize, Deserialize)]
| ^^^^^^^^^
| |
| data moved here
| move occurs because `unrecognized` has type `ErrorKind`, which does not implement the `Copy` trait
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider borrowing here
|
210 | #[derive(&Serialize, Deserialize)]
| +
Unit variant of externally tagged enum cannot be deserialized from the string
token by itself. It is ContentDeserializer + serde_test::Deserializer that makes
this possible, because serde_test::Deserializer produces Content::Str() from
Token::BorrowedStr() and ContentDeserializer produces unit variant from Content::Str().
The following tokens all produces Content::String(variant):
- Token::String(variant)
- Token::Str(variant)
- Token::UnitVariant { variant, .. }
Token::BorrowedStr(variant) produces Content::Str(variant) that was the real purpose to
use it in test in #933. This actually makes this test testing `Content` rather than type itself.
Correct way to represent enum one of:
- [xxxVariant { .. }]
- [Enum { .. }, xxxVariant { variant, .. }]
- [Enum { .. }, String(variant), <variant content>]
- [Enum { .. }, Str(variant), <variant content>]
- [Enum { .. }, BorrowedStr(variant), <variant content>]
error: the feature `lang_items` is internal to the compiler or standard library
--> src/main.rs:1:12
|
1 | #![feature(lang_items, start)]
| ^^^^^^^^^^
|
= note: using it is strongly discouraged
= note: `#[deny(internal_features)]` on by default
warning: empty String is being created manually
--> test_suite/tests/test_annotations.rs:2280:29
|
2280 | let data = Data::C { t: "".to_string() };
| ^^^^^^^^^^^^^^ help: consider using: `String::new()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_string_new
= note: `-W clippy::manual-string-new` implied by `-W clippy::pedantic`
error: field `option` is never read
--> test_suite/tests/test_gen.rs:666:9
|
665 | struct ImplicitlyBorrowedOption<'a> {
| ------------------------ field in this struct
666 | option: std::option::Option<&'a str>,
| ^^^^^^
|
note: the lint level is defined here
--> test_suite/tests/test_gen.rs:5:9
|
5 | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(dead_code)]` implied by `#[deny(warnings)]`
error: fields `ty` and `id` are never read
--> test_suite/tests/test_gen.rs:696:9
|
695 | struct RelObject<'a> {
| --------- fields in this struct
696 | ty: &'a str,
| ^^
697 | id: String,
| ^^
error: field `field` is never read
--> test_suite/tests/test_gen.rs:740:17
|
739 | struct MacroRules<'a> {
| ---------- field in this struct
740 | field: $field,
| ^^^^^
...
745 | deriving!(&'a str);
| ------------------ in this macro invocation
|
= note: this error originates in the macro `deriving` (in Nightly builds, run with -Z macro-backtrace for more info)
error: field `f` is never read
--> test_suite/tests/test_gen.rs:756:9
|
754 | struct BorrowLifetimeInsideMacro<'a> {
| ------------------------- field in this struct
755 | #[serde(borrow = "'a")]
756 | f: mac!(Cow<'a, str>),
| ^
warning: fields `question` and `answer` are never read
--> test_suite/tests/test_annotations.rs:2969:9
|
2968 | struct Struct {
| ------ fields in this struct
2969 | question: String,
| ^^^^^^^^
2970 | answer: u32,
| ^^^^^^
|
= note: `#[warn(dead_code)]` on by default
1.0.0 does not work with workspaces.
error: No such file or directory (os error 2)
--> test_suite/tests/regression.rs:2:5
|
2 | automod::dir!("tests/regression");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro `automod::dir` (in Nightly builds, run with -Z macro-backtrace for more info)
error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
--> test_suite/tests/test_de.rs:202:12
|
202 | .chain(vec![Token::MapEnd].into_iter())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `vec![Token::MapEnd]`
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
--> /home/david/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:522:12
|
522 | U: IntoIterator<Item = Self::Item>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `-D clippy::useless-conversion` implied by `-D clippy::all`
Previously if someone wrote an enum containing:
- `A` (untagged)
- `B` (tagged)
- `C` (tagged)
- `D` (untagged)
- `E` (tagged)
- `F` (untagged)
serde_derive would produce errors referring to B and E only, saying
you're supposed to put untagged variants at the end. The choice of B and
E for this error doesn't make a lot of sense because in order to resolve
the issue, the user must either:
- move A and D down
or:
- move B, C, and E up.
This commit changes the error to appear on A and D instead.
This count should mean the number of fields expected in the serialized form,
so if some fields are skipped, they shouldn't be counted
Methods affected:
- Deserializer::deserialize_tuple
- Deserializer::deserialize_tuple_struct
- VariantAccess::tuple_variant
Without serde(bound = ""), serde_derive infers a bound of `T: Serialize`
for the generated Serialize impl and `T: Deserialize<'de> + Default` for
the Deserialize impl. `X` implements none of these so the generated code
would fail to compile.
error[E0277]: the trait bound `X: Serialize` is not satisfied
--> test_suite/tests/test_gen.rs:268:14
|
268 | assert::<PhantomDataWrapper<X>>();
| ^^^^^^^^^^^^^^^^^^^^^ the trait `Serialize` is not implemented for `X`
|
= help: the following other types implement trait `Serialize`:
&'a T
&'a mut T
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
(T0, T1, T2, T3, T4, T5)
and 248 others
note: required for `PhantomDataWrapper<X>` to implement `Serialize`
--> test_suite/tests/test_gen.rs:262:14
|
262 | #[derive(Serialize, Deserialize)]
| ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro
263 | //#[serde(bound = "")]
264 | struct PhantomDataWrapper<T> {
| ^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `assert`
--> test_suite/tests/test_gen.rs:767:14
|
767 | fn assert<T: Serialize + DeserializeOwned>() {}
| ^^^^^^^^^ required by this bound in `assert`
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `X: Deserialize<'_>` is not satisfied
--> test_suite/tests/test_gen.rs:268:14
|
268 | assert::<PhantomDataWrapper<X>>();
| ^^^^^^^^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `X`
|
= help: the following other types implement trait `Deserialize<'de>`:
<&'a Path as Deserialize<'de>>
<&'a [u8] as Deserialize<'de>>
<&'a str as Deserialize<'de>>
<() as Deserialize<'de>>
<(T0, T1) as Deserialize<'de>>
<(T0, T1, T2) as Deserialize<'de>>
<(T0, T1, T2, T3) as Deserialize<'de>>
<(T0, T1, T2, T3, T4) as Deserialize<'de>>
and 331 others
note: required for `PhantomDataWrapper<X>` to implement `for<'de> Deserialize<'de>`
--> test_suite/tests/test_gen.rs:262:25
|
262 | #[derive(Serialize, Deserialize)]
| ^^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro
263 | //#[serde(bound = "")]
264 | struct PhantomDataWrapper<T> {
| ^^^^^^^^^^^^^^^^^^^^^
= note: required for `PhantomDataWrapper<X>` to implement `DeserializeOwned`
note: required by a bound in `assert`
--> test_suite/tests/test_gen.rs:767:26
|
767 | fn assert<T: Serialize + DeserializeOwned>() {}
| ^^^^^^^^^^^^^^^^ required by this bound in `assert`
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `X: Default` is not satisfied
--> test_suite/tests/test_gen.rs:268:14
|
268 | assert::<PhantomDataWrapper<X>>();
| ^^^^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `X`
|
note: required for `PhantomDataWrapper<X>` to implement `for<'de> Deserialize<'de>`
--> test_suite/tests/test_gen.rs:262:25
|
262 | #[derive(Serialize, Deserialize)]
| ^^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro
263 | //#[serde(bound = "")]
264 | struct PhantomDataWrapper<T> {
| ^^^^^^^^^^^^^^^^^^^^^
= note: required for `PhantomDataWrapper<X>` to implement `DeserializeOwned`
note: required by a bound in `assert`
--> test_suite/tests/test_gen.rs:767:26
|
767 | fn assert<T: Serialize + DeserializeOwned>() {}
| ^^^^^^^^^^^^^^^^ required by this bound in `assert`
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `X` with `#[derive(Default)]`
|
779 | #[derive(Default)]
|