Compare commits

...

61 Commits

Author SHA1 Message Date
David Tolnay 3d0251666e Release 1.0.143 2022-08-08 19:12:43 -07:00
David Tolnay 7770da4929 Merge pull request #2253 from taiki-e/test-cfg
Invert build.rs cfgs in serde_test
2022-08-08 19:08:35 -07:00
Taiki Endo a5fd85a9ef Invert build.rs cfgs in serde_test 2022-08-04 20:20:31 +09:00
David Tolnay abb2a8494d Release 1.0.142 2022-08-03 07:09:15 -07:00
David Tolnay a31d0be191 Update keywords in crates.io metadata 2022-08-02 10:38:57 -07:00
David Tolnay d786e750d7 Release 1.0.141 2022-08-01 08:50:46 -07:00
David Tolnay 10e4839f83 Move Postcard link up to Bincode spot
Bincode has been in prerelease limbo for nearly a year and the readme
does not mention anything related to Serde, so it is not serving as a
good first link to a Serde binary format.
2022-08-01 08:49:45 -07:00
David Tolnay 85e72653c8 Add categories to crates.io metadata 2022-08-01 00:06:49 -07:00
David Tolnay c9cc8a8924 Add authors to Cargo.toml 2022-07-31 19:25:47 -07:00
David Tolnay a925ce4119 Sort package entries in Cargo.toml 2022-07-31 19:19:07 -07:00
David Tolnay c5f6338ce2 Release 1.0.140 2022-07-20 09:26:28 -07:00
David Tolnay 5185487d73 Merge pull request #2251 from taiki-e/derive-cfg
Invert build.rs cfgs in serde_derive
2022-07-20 09:25:14 -07:00
Taiki Endo efaafd4458 Invert build.rs cfgs in serde_derive 2022-07-21 01:15:37 +09:00
David Tolnay a0eb83a5d4 Resolve invalid_utf8_in_unchecked clippy lint in ancient test code
error: non UTF-8 literal in `std::str::from_utf8_unchecked`
       --> test_suite/tests/test_ser.rs:803:25
        |
    803 |     let path = unsafe { str::from_utf8_unchecked(b"Hello \xF0\x90\x80World") };
        |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = note: `-D clippy::invalid-utf8-in-unchecked` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#invalid_utf8_in_unchecked
2022-07-18 21:29:39 -07:00
David Tolnay 7cc6f7fbb0 Ignore new_without_default clippy lint
error: you should consider adding a `Default` implementation for `UnitDeserializer<E>`
       --> serde/src/de/value.rs:144:5
        |
    144 | /     pub fn new() -> Self {
    145 | |         UnitDeserializer {
    146 | |             marker: PhantomData,
    147 | |         }
    148 | |     }
        | |_____^
        |
        = note: `-D clippy::new-without-default` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
    help: try adding this
        |
    142 + impl<E> Default for UnitDeserializer<E> {
    143 +     fn default() -> Self {
    144 +         Self::new()
    145 +     }
    146 + }
        |
2022-07-11 21:19:58 -07:00
David Tolnay 44b9496c91 Release 1.0.139 2022-07-10 21:51:21 -07:00
David Tolnay 7e1486d0da Merge pull request #2246 from dtolnay/valuedenew
Add constructor function for all IntoDeserializer impls
2022-07-10 21:50:24 -07:00
David Tolnay 8170ffef2e Add constructor function for all IntoDeserializer impls 2022-07-10 21:42:03 -07:00
David Tolnay 4b622f6bbf Release 1.0.138 2022-07-01 20:09:56 -07:00
David Tolnay 0ee71c70af Ignore explicit_auto_deref clippy lint
error: deref which would be done by auto-deref
        --> serde/src/de/impls.rs:2014:59
         |
    2014 | ...                   Err(Error::unknown_field(&*value, FIELDS))
         |                                                 ^^^^^^ help: try this: `value`
         |
         = note: `-D clippy::explicit-auto-deref` implied by `-D clippy::all`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref

    error: deref which would be done by auto-deref
        --> serde/src/de/impls.rs:2354:55
         |
    2354 | ...                   Err(Error::unknown_field(&*value, FIELDS))
         |                                                 ^^^^^^ help: try this: `value`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
2022-07-01 19:41:14 -07:00
David Tolnay 6c098e497e Merge pull request #2240 from Kixunil/patch-1
Call `reserve()` in `DeserializeSeed` example
2022-06-30 09:39:25 -07:00
Martin Habovštiak 41ffa6df7e Call reserve() in DeserializeSeed example
This suggests calling `reserve()` in example code so that people who ~blindly copy it get faster code.
2022-06-30 18:28:52 +02:00
David Tolnay 845b900fd5 Exclude deliberately pinned prettyplease crate from cargo outdated 2022-06-22 21:07:57 -07:00
David Tolnay 7891ae7184 Merge pull request #2228 from serde-rs/expandtest
Update macrotest to 1.0.9 and enable in CI
2022-06-20 03:53:50 -07:00
David Tolnay bac90d19b9 Update macrotest to 1.0.9 and enable in CI 2022-06-20 03:40:49 -07:00
David Tolnay 227bf3023a Merge pull request #2229 from dtolnay/expandlinguist
Mark expandtest outputs as generated code
2022-06-20 03:40:37 -07:00
David Tolnay f4535f68c1 Mark expandtest outputs as generated code 2022-06-20 03:27:20 -07:00
David Tolnay c6c35b5a31 Ignore buggy doc_link_with_quotes clippy lint
https://github.com/rust-lang/rust-clippy/issues/8961

    error: possible intra-doc link using quotes instead of backticks
       --> serde_test/src/token.rs:277:5
        |
    277 |     /// let vec = vec!['a', 'b', 'c'];
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = note: `-D clippy::doc-link-with-quotes` implied by `-D clippy::pedantic`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_link_with_quotes
2022-06-07 00:30:50 -07:00
David Tolnay 31e51324e2 Add actions job to notice outdated dependencies 2022-06-06 16:09:41 -07:00
David Tolnay bc3f24e0e9 Update toolchain_find dependency to 0.2 2022-06-06 16:09:14 -07:00
David Tolnay 2e38e2bf2f Ignore derive_partial_eq_without_eq clippy lint
error: you are deriving `PartialEq` and can implement `Eq`
      --> serde/src/de/value.rs:51:17
       |
    51 | #[derive(Clone, PartialEq)]
       |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = note: `-D clippy::derive-partial-eq-without-eq` implied by `-D clippy::all`
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> serde_derive/src/internals/case.rs:13:23
       |
    13 | #[derive(Copy, Clone, PartialEq)]
       |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
     --> test_suite/tests/unstable/mod.rs:6:21
      |
    6 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
      |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
     --> test_suite/tests/test_ignored_any.rs:7:10
      |
    7 | #[derive(PartialEq, Debug, Deserialize)]
      |          ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
     --> test_suite/tests/test_identifier.rs:7:34
      |
    7 |     #[derive(Deserialize, Debug, PartialEq)]
      |                                  ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_identifier.rs:24:34
       |
    24 |     #[derive(Deserialize, Debug, PartialEq)]
       |                                  ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_identifier.rs:41:34
       |
    41 |     #[derive(Deserialize, Debug, PartialEq)]
       |                                  ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_identifier.rs:59:34
       |
    59 |     #[derive(Deserialize, Debug, PartialEq)]
       |                                  ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_ser.rs:46:10
       |
    46 | #[derive(PartialEq, Debug)]
       |          ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_value.rs:11:34
       |
    11 |     #[derive(Deserialize, Debug, PartialEq)]
       |                                  ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_de_error.rs:15:23
       |
    15 | #[derive(Copy, Clone, PartialEq, Debug, Deserialize)]
       |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_de_error.rs:18:10
       |
    18 | #[derive(PartialEq, Debug, Deserialize)]
       |          ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_de_error.rs:26:10
       |
    26 | #[derive(PartialEq, Debug, Deserialize)]
       |          ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_de_error.rs:34:10
       |
    34 | #[derive(PartialEq, Debug, Deserialize)]
       |          ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_de_error.rs:41:19
       |
    41 | #[derive(Default, PartialEq, Debug)]
       |                   ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_de_error.rs:60:10
       |
    60 | #[derive(PartialEq, Debug, Deserialize)]
       |          ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_borrow.rs:70:34
       |
    70 |     #[derive(Deserialize, Debug, PartialEq)]
       |                                  ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_borrow.rs:97:34
       |
    97 |     #[derive(Deserialize, Debug, PartialEq)]
       |                                  ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_borrow.rs:106:34
        |
    106 |     #[derive(Deserialize, Debug, PartialEq)]
        |                                  ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_de.rs:43:23
       |
    43 | #[derive(Copy, Clone, PartialEq, Debug, Deserialize)]
       |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_de.rs:46:10
       |
    46 | #[derive(PartialEq, Debug, Deserialize)]
       |          ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_de.rs:49:10
       |
    49 | #[derive(PartialEq, Debug, Deserialize)]
       |          ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_de.rs:52:10
       |
    52 | #[derive(PartialEq, Debug, Deserialize)]
       |          ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_de.rs:76:10
       |
    76 | #[derive(PartialEq, Debug, Deserialize)]
       |          ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_de.rs:82:10
       |
    82 | #[derive(PartialEq, Debug, Deserialize)]
       |          ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_de.rs:102:10
        |
    102 | #[derive(PartialEq, Debug, Deserialize)]
        |          ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_de.rs:109:19
        |
    109 | #[derive(Default, PartialEq, Debug)]
        |                   ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_de.rs:128:10
        |
    128 | #[derive(PartialEq, Debug, Deserialize)]
        |          ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_de.rs:135:10
        |
    135 | #[derive(PartialEq, Debug)]
        |          ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_de.rs:185:14
        |
    185 |     #[derive(PartialEq, Debug, Deserialize)]
        |              ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> test_suite/tests/test_macros.rs:25:17
       |
    25 | #[derive(Debug, PartialEq, Serialize, Deserialize)]
       |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_macros.rs:110:17
        |
    110 | #[derive(Debug, PartialEq, Serialize, Deserialize)]
        |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_macros.rs:580:21
        |
    580 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
        |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_macros.rs:607:21
        |
    607 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
        |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_macros.rs:681:21
        |
    681 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
        |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_macros.rs:684:21
        |
    684 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
        |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_macros.rs:816:21
        |
    816 |     #[derive(Debug, PartialEq, Deserialize)]
        |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_macros.rs:976:21
        |
    976 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
        |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_macros.rs:1027:21
         |
    1027 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
         |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_macros.rs:1273:21
         |
    1273 |     #[derive(Debug, PartialEq, Deserialize)]
         |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_macros.rs:1342:21
         |
    1342 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
         |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_macros.rs:1413:21
         |
    1413 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
         |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_macros.rs:1450:21
         |
    1450 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
         |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_macros.rs:1474:21
         |
    1474 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
         |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_macros.rs:1509:21
         |
    1509 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
         |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_macros.rs:1543:21
         |
    1543 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
         |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_macros.rs:1601:21
         |
    1601 |     #[derive(Debug, PartialEq, Deserialize)]
         |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_macros.rs:1743:45
         |
    1743 |     #[derive(Serialize, Deserialize, Debug, PartialEq)]
         |                                             ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_macros.rs:1763:45
         |
    1763 |     #[derive(Serialize, Deserialize, Debug, PartialEq)]
         |                                             ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_macros.rs:1770:45
         |
    1770 |     #[derive(Serialize, Deserialize, Debug, PartialEq)]
         |                                             ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_macros.rs:1870:21
         |
    1870 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
         |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_macros.rs:1888:21
         |
    1888 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
         |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_annotations.rs:108:17
        |
    108 | #[derive(Debug, PartialEq, Serialize, Deserialize)]
        |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_annotations.rs:124:17
        |
    124 | #[derive(Debug, PartialEq, Serialize, Deserialize)]
        |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_annotations.rs:147:17
        |
    147 | #[derive(Debug, PartialEq, Serialize, Deserialize)]
        |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_annotations.rs:344:17
        |
    344 | #[derive(Debug, PartialEq, Deserialize)]
        |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_annotations.rs:394:17
        |
    394 | #[derive(Debug, PartialEq)]
        |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_annotations.rs:413:17
        |
    413 | #[derive(Debug, PartialEq)]
        |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_annotations.rs:458:17
        |
    458 | #[derive(Debug, PartialEq, Serialize, Deserialize)]
        |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_annotations.rs:512:17
        |
    512 | #[derive(Debug, PartialEq, Serialize, Deserialize)]
        |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_annotations.rs:520:17
        |
    520 | #[derive(Debug, PartialEq, Serialize, Deserialize)]
        |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_annotations.rs:528:17
        |
    528 | #[derive(Debug, PartialEq, Deserialize)]
        |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_annotations.rs:647:17
        |
    647 | #[derive(Debug, PartialEq, Serialize, Deserialize)]
        |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_gen.rs:835:17
        |
    835 | #[derive(Debug, PartialEq, Deserialize)]
        |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> test_suite/tests/test_annotations.rs:675:17
        |
    675 | #[derive(Debug, PartialEq, Deserialize)]
        |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:1047:17
         |
    1047 | #[derive(Debug, PartialEq)]
         |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:1050:17
         |
    1050 | #[derive(Debug, PartialEq)]
         |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:1196:17
         |
    1196 | #[derive(Debug, PartialEq, Serialize, Deserialize)]
         |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:1514:17
         |
    1514 | #[derive(Debug, PartialEq, Deserialize)]
         |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:1548:41
         |
    1548 | #[derive(Clone, Serialize, Deserialize, PartialEq, Debug)]
         |                                         ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:1566:41
         |
    1566 | #[derive(Clone, Serialize, Deserialize, PartialEq, Debug)]
         |                                         ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:1600:30
         |
    1600 | #[derive(Clone, Deserialize, PartialEq, Debug)]
         |                              ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:1803:21
         |
    1803 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
         |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:1843:21
         |
    1843 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
         |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:1852:21
         |
    1852 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
         |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:1947:21
         |
    1947 |     #[derive(Debug, PartialEq, Deserialize)]
         |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2003:21
         |
    2003 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
         |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2037:21
         |
    2037 |     #[derive(Debug, PartialEq, Serialize, Deserialize)]
         |                     ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2074:45
         |
    2074 |     #[derive(Deserialize, Serialize, Debug, PartialEq)]
         |                                             ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2080:45
         |
    2080 |     #[derive(Deserialize, Serialize, Debug, PartialEq)]
         |                                             ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2157:38
         |
    2157 |     #[derive(Serialize, Deserialize, PartialEq, Debug)]
         |                                      ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2193:38
         |
    2193 |     #[derive(Serialize, Deserialize, PartialEq, Debug)]
         |                                      ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2200:38
         |
    2200 |     #[derive(Serialize, Deserialize, PartialEq, Debug)]
         |                                      ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2240:38
         |
    2240 |     #[derive(Serialize, Deserialize, PartialEq, Debug)]
         |                                      ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2279:38
         |
    2279 |     #[derive(Serialize, Deserialize, PartialEq, Debug)]
         |                                      ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2316:38
         |
    2316 |     #[derive(Serialize, Deserialize, PartialEq, Debug)]
         |                                      ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2359:38
         |
    2359 |     #[derive(Serialize, Deserialize, PartialEq, Debug)]
         |                                      ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2390:38
         |
    2390 |     #[derive(Serialize, Deserialize, PartialEq, Debug)]
         |                                      ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2421:38
         |
    2421 |     #[derive(Serialize, Deserialize, PartialEq, Debug)]
         |                                      ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2426:38
         |
    2426 |     #[derive(Serialize, Deserialize, PartialEq, Debug)]
         |                                      ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2483:38
         |
    2483 |     #[derive(Serialize, Deserialize, PartialEq, Debug)]
         |                                      ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2507:38
         |
    2507 |     #[derive(Serialize, Deserialize, PartialEq, Debug)]
         |                                      ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2521:27
         |
    2521 |     #[derive(Deserialize, PartialEq, Debug)]
         |                           ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2552:27
         |
    2552 |     #[derive(Deserialize, PartialEq, Debug)]
         |                           ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2558:27
         |
    2558 |     #[derive(Deserialize, PartialEq, Debug)]
         |                           ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2586:14
         |
    2586 |     #[derive(PartialEq, Debug)]
         |              ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2624:27
         |
    2624 |     #[derive(Deserialize, PartialEq, Debug)]
         |                           ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
        --> test_suite/tests/test_annotations.rs:2647:27
         |
    2647 |     #[derive(Deserialize, PartialEq, Debug)]
         |                           ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq
2022-05-21 20:43:51 -07:00
David Tolnay 819f90d9f6 Ignore unused_macro_rules warning in test macros
warning: 1st rule of macro `btreeset` is never used
     --> test_suite/tests/macros/mod.rs:5:5
      |
    5 |     () => {
      |     ^^
      |
      = note: `#[warn(unused_macro_rules)]` on by default

    warning: 1st rule of macro `hashset` is never used
      --> test_suite/tests/macros/mod.rs:27:5
       |
    27 |     () => {
       |     ^^

    warning: 1st rule of macro `hashmap` is never used
      --> test_suite/tests/macros/mod.rs:44:5
       |
    44 |     () => {
       |     ^^

    warning: 1st rule of macro `hashset` is never used
      --> test_suite/tests/macros/mod.rs:27:5
       |
    27 |     () => {
       |     ^^
       |
       = note: `#[warn(unused_macro_rules)]` on by default
2022-05-12 21:33:43 -07:00
David Tolnay 2eed86cd67 Remove doc(hidden) attribute that is being phased out
warning: `#[doc(hidden)]` is ignored on trait impl items
       --> serde/src/de/impls.rs:796:5
        |
    796 |     #[doc(hidden)]
        |     ^^^^^^^^^^^^^^ help: remove this attribute
        |
        = note: `#[warn(unused_attributes)]` on by default
        = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
        = note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item
2022-05-09 21:16:16 -07:00
David Tolnay 3921b57435 Run miri in stricter miri-strict-provenance mode 2022-05-06 04:01:35 -07:00
David Tolnay 68069d734a Fix needless_borrow for both value=Cow<str> and value=&str 2022-05-05 21:07:33 -07:00
David Tolnay dc84693507 Resolve needless_borrow clippy lint
error: this expression creates a reference which is immediately dereferenced by the compiler
        --> serde/src/de/impls.rs:2015:58
         |
    2015 | ...                   Err(Error::unknown_field(&value, FIELDS))
         |                                                ^^^^^^ help: change this to: `value`
         |
         = note: `-D clippy::needless-borrow` implied by `-D clippy::all`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression creates a reference which is immediately dereferenced by the compiler
        --> serde/src/de/impls.rs:2355:54
         |
    2355 | ...                   Err(Error::unknown_field(&value, FIELDS))
         |                                                ^^^^^^ help: change this to: `value`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
2022-05-05 21:01:03 -07:00
David Tolnay 4cf012c5be Resolve extra_unused_lifetimes clippy lint
error: this lifetime isn't used in the impl
       --> serde/src/de/value.rs:607:11
        |
    607 | impl<'de, 'a, E> de::EnumAccess<'de> for StringDeserializer<E>
        |           ^^
        |
        = note: `-D clippy::extra-unused-lifetimes` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
2022-05-05 21:00:37 -07:00
David Tolnay 17c3c0cf86 Release 1.0.137 2022-04-30 21:45:31 -07:00
David Tolnay 210e6c354e Clean up clippy allows which are superseded by msrv in clippy.toml 2022-04-30 21:35:00 -07:00
David Tolnay 41823a96df Ignore more type_repetition_in_bounds
I'm not sure what is going on with this lint but it's triggering in a
lot of test code. Will need to investigate further.

    error: this type has already been used as a bound predicate
       --> test_suite/tests/test_gen.rs:194:21
        |
    194 |             bound = "E: SerializeWith + DeserializeWith"
        |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = note: `-D clippy::type-repetition-in-bounds` implied by `-D clippy::pedantic`
        = help: consider combining the bounds: `"E: SerializeWith + DeserializeWith": "E: SerializeWith + DeserializeWith" + "E: SerializeWith + DeserializeWith"`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

    error: this type has already been used as a bound predicate
       --> test_suite/tests/test_gen.rs:184:21
        |
    184 |     #[serde(bound = "D: SerializeWith + DeserializeWith")]
        |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: consider combining the bounds: `"D: SerializeWith + DeserializeWith": "D: SerializeWith + DeserializeWith" + "D: SerializeWith + DeserializeWith"`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

    error: this type has already been used as a bound predicate
       --> test_suite/tests/test_gen.rs:210:31
        |
    210 |             bound(serialize = "E: SerializeWith")
        |                               ^^^^^^^^^^^^^^^^^^
        |
        = help: consider combining the bounds: `"E: SerializeWith": "E: SerializeWith"`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

    error: this type has already been used as a bound predicate
       --> test_suite/tests/test_gen.rs:201:31
        |
    201 |     #[serde(bound(serialize = "D: SerializeWith", deserialize = "D: DeserializeWith"))]
        |                               ^^^^^^^^^^^^^^^^^^
        |
        = help: consider combining the bounds: `"D: SerializeWith": "D: SerializeWith"`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

    error: this type has already been used as a bound predicate
       --> test_suite/tests/test_gen.rs:231:21
        |
    231 |             bound = "E: SerializeWith + DeserializeWith"
        |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: consider combining the bounds: `"E: SerializeWith + DeserializeWith": "E: SerializeWith + DeserializeWith" + "E: SerializeWith + DeserializeWith"`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

    error: this type has already been used as a bound predicate
       --> test_suite/tests/test_gen.rs:221:21
        |
    221 |     #[serde(bound = "D: SerializeWith + DeserializeWith")]
        |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: consider combining the bounds: `"D: SerializeWith + DeserializeWith": "D: SerializeWith + DeserializeWith" + "D: SerializeWith + DeserializeWith"`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

    error: this type has already been used as a bound predicate
       --> test_suite/tests/test_gen.rs:247:31
        |
    247 |             bound(serialize = "E: SerializeWith")
        |                               ^^^^^^^^^^^^^^^^^^
        |
        = help: consider combining the bounds: `"E: SerializeWith": "E: SerializeWith"`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

    error: this type has already been used as a bound predicate
       --> test_suite/tests/test_gen.rs:238:31
        |
    238 |     #[serde(bound(serialize = "D: SerializeWith", deserialize = "D: DeserializeWith"))]
        |                               ^^^^^^^^^^^^^^^^^^
        |
        = help: consider combining the bounds: `"D: SerializeWith": "D: SerializeWith"`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

    error: this type has already been used as a bound predicate
      --> test_suite/tests/test_annotations.rs:84:5
       |
    84 |     C: MyDefault,
       |     ^^^^^^^^^^^^
       |
       = note: `-D clippy::type-repetition-in-bounds` implied by `-D clippy::pedantic`
       = help: consider combining the bounds: `C: MyDefault`
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

    error: this type has already been used as a bound predicate
      --> test_suite/tests/test_annotations.rs:85:5
       |
    85 |     E: MyDefault,
       |     ^^^^^^^^^^^^
       |
       = help: consider combining the bounds: `E: MyDefault`
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

    error: this type has already been used as a bound predicate
       --> test_suite/tests/test_annotations.rs:105:5
        |
    105 |     C: MyDefault;
        |     ^^^^^^^^^^^^
        |
        = help: consider combining the bounds: `C: MyDefault`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

    error: this type has already been used as a bound predicate
        --> test_suite/tests/test_annotations.rs:1066:5
         |
    1066 |     B: 'a,
         |     ^^^^^
         |
         = help: consider combining the bounds: ``
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

    error: this type has already been used as a bound predicate
        --> test_suite/tests/test_annotations.rs:1067:5
         |
    1067 |     D: SerializeWith,
         |     ^^^^^^^^^^^^^^^^
         |
         = help: consider combining the bounds: `D: SerializeWith`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

    error: this type has already been used as a bound predicate
        --> test_suite/tests/test_annotations.rs:1106:5
         |
    1106 |     B: SerializeWith,
         |     ^^^^^^^^^^^^^^^^
         |
         = help: consider combining the bounds: `B: SerializeWith`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

    error: this type has already been used as a bound predicate
        --> test_suite/tests/test_annotations.rs:1150:5
         |
    1150 |     B: SerializeWith,
         |     ^^^^^^^^^^^^^^^^
         |
         = help: consider combining the bounds: `B: SerializeWith`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

    error: this type has already been used as a bound predicate
        --> test_suite/tests/test_annotations.rs:1368:5
         |
    1368 |     B: DeserializeWith,
         |     ^^^^^^^^^^^^^^^^^^
         |
         = help: consider combining the bounds: `B: DeserializeWith`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds
2022-04-30 21:32:36 -07:00
David Tolnay 7ca13ff240 Ignore type_repetition_in_bounds lint that is incompatible with msrv
https://github.com/rust-lang/rust-clippy/issues/8772
2022-04-30 21:32:26 -07:00
David Tolnay 52391fd868 Inform clippy of supported compiler version in clippy.toml 2022-04-30 20:40:23 -07:00
David Tolnay 9b2d8dfc6b Add a miri test job in CI 2022-04-28 20:43:03 -07:00
David Tolnay 07ba7ea8dd Update workflows to actions/checkout@v3 2022-04-24 19:06:18 -07:00
David Tolnay 9f29f6bb4a Disable expandtest on miri 2022-04-24 16:01:52 -07:00
David Tolnay f6c104fd1d Ignore unused ignore attribute warning in some configurations 2022-04-24 16:01:22 -07:00
David Tolnay 8a3a6fb101 Disable ui test on miri 2022-04-24 15:21:17 -07:00
David Tolnay b5c3b5e8e5 Update ui test suite to nightly-2022-04-17 2022-04-16 23:48:27 -07:00
David Tolnay 996d171461 Merge pull request #2201 from atouchet/urls
Update some URLs
2022-04-14 02:50:36 -07:00
Alex Touchet e1c4517335 Update some URLs 2022-04-13 21:42:37 -07:00
David Tolnay 6e94a27c76 Merge pull request #2194 from serde-rs/exhaustive
Update exhaustive matching to syn 1.0.90
2022-03-28 10:27:27 -07:00
David Tolnay b23a768414 Update exhaustive matching to syn 1.0.90 2022-03-28 10:21:37 -07:00
David Tolnay 7e19ae8c94 Fix rust-version in serde_test Cargo.toml too
#2168
2022-01-25 14:49:56 -08:00
David Tolnay 404a1d142a Fix rust-version in Cargo.toml
Closes #2168.
2022-01-25 14:42:09 -08:00
David Tolnay 02bd79a0ba Release 1.0.136 2022-01-25 13:34:29 -08:00
David Tolnay c3ce2c934a Merge pull request #2167 from serde-rs/error128
Render 128-bit integer value into Visitor errors
2022-01-25 13:07:01 -08:00
David Tolnay 0d71ac84b5 Render 128-bit integer value into Visitor errors 2022-01-25 12:06:35 -08:00
David Tolnay 82c3eb7ba4 Add test of visitor error messages 2022-01-25 11:24:53 -08:00
David Tolnay 8932c852a5 Release 1.0.135 2022-01-22 16:04:17 -08:00
David Tolnay 9f3dd3c7c4 Merge pull request #2163 from serde-rs/discord
Add discord invite links
2022-01-22 11:23:32 -08:00
David Tolnay dd9b415ff9 Add discord invite links 2022-01-22 11:21:08 -08:00
60 changed files with 1286 additions and 827 deletions
+1
View File
@@ -0,0 +1 @@
test_suite/tests/expand/*.expanded.rs linguist-generated
+41 -11
View File
@@ -13,15 +13,19 @@ jobs:
name: Test suite name: Test suite
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly - uses: dtolnay/rust-toolchain@nightly
- run: cd test_suite && cargo test --features unstable - run: cd test_suite && cargo test --features unstable
- uses: dtolnay/install@cargo-expand
if: github.event_name != 'pull_request'
- run: cd test_suite && cargo test --features expandtest --test expandtest -- --include-ignored
if: github.event_name != 'pull_request'
windows: windows:
name: Test suite (windows) name: Test suite (windows)
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly - uses: dtolnay/rust-toolchain@nightly
- run: cd test_suite && cargo test --features unstable -- --skip ui --exact - run: cd test_suite && cargo test --features unstable -- --skip ui --exact
@@ -33,7 +37,7 @@ jobs:
matrix: matrix:
rust: [stable, beta] rust: [stable, beta]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master - uses: dtolnay/rust-toolchain@master
with: with:
toolchain: ${{matrix.rust}} toolchain: ${{matrix.rust}}
@@ -50,7 +54,7 @@ jobs:
matrix: matrix:
os: [ubuntu, windows] os: [ubuntu, windows]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly - uses: dtolnay/rust-toolchain@nightly
- run: cd serde && cargo build - run: cd serde && cargo build
- run: cd serde && cargo build --no-default-features - run: cd serde && cargo build --no-default-features
@@ -59,12 +63,16 @@ jobs:
- run: cd serde && cargo test --features derive,rc,unstable - run: cd serde && cargo test --features derive,rc,unstable
- run: cd test_suite/no_std && cargo build - run: cd test_suite/no_std && cargo build
if: matrix.os != 'windows' if: matrix.os != 'windows'
- run: cd serde_derive && cargo check --tests
env:
RUSTFLAGS: --cfg exhaustive ${{env.RUSTFLAGS}}
if: matrix.os != 'windows'
msrv: msrv:
name: Rust 1.13.0 name: Rust 1.13.0
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.13.0 - uses: dtolnay/rust-toolchain@1.13.0
- name: Get timestamp for cache - name: Get timestamp for cache
id: date id: date
@@ -85,7 +93,7 @@ jobs:
matrix: matrix:
rust: [1.19.0, 1.20.0, 1.21.0, 1.25.0, 1.26.0, 1.34.0] rust: [1.19.0, 1.20.0, 1.21.0, 1.25.0, 1.26.0, 1.34.0]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master - uses: dtolnay/rust-toolchain@master
with: with:
toolchain: ${{matrix.rust}} toolchain: ${{matrix.rust}}
@@ -100,7 +108,7 @@ jobs:
matrix: matrix:
rust: [1.27.0, 1.28.0] rust: [1.27.0, 1.28.0]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master - uses: dtolnay/rust-toolchain@master
with: with:
toolchain: ${{matrix.rust}} toolchain: ${{matrix.rust}}
@@ -113,7 +121,7 @@ jobs:
name: Rust 1.31.0 name: Rust 1.31.0
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.31.0 - uses: dtolnay/rust-toolchain@1.31.0
- run: cd serde && cargo check --no-default-features - run: cd serde && cargo check --no-default-features
- run: cd serde && cargo check - run: cd serde && cargo check
@@ -123,7 +131,7 @@ jobs:
name: Rust 1.36.0 name: Rust 1.36.0
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.36.0 - uses: dtolnay/rust-toolchain@1.36.0
- run: cd serde && cargo build --no-default-features --features alloc - run: cd serde && cargo build --no-default-features --features alloc
@@ -131,7 +139,7 @@ jobs:
name: Emscripten name: Emscripten
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly - uses: dtolnay/rust-toolchain@nightly
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1
with: with:
@@ -154,7 +162,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@clippy - uses: dtolnay/rust-toolchain@clippy
- run: cd serde && cargo clippy --features rc,unstable -- -Dclippy::all -Dclippy::pedantic - run: cd serde && cargo clippy --features rc,unstable -- -Dclippy::all -Dclippy::pedantic
- run: cd serde_derive && cargo clippy -- -Dclippy::all -Dclippy::pedantic - run: cd serde_derive && cargo clippy -- -Dclippy::all -Dclippy::pedantic
@@ -162,3 +170,25 @@ jobs:
- run: cd serde_test && cargo clippy -- -Dclippy::all -Dclippy::pedantic - run: cd serde_test && cargo clippy -- -Dclippy::all -Dclippy::pedantic
- run: cd test_suite && cargo clippy --tests --features unstable -- -Dclippy::all -Dclippy::pedantic - run: cd test_suite && cargo clippy --tests --features unstable -- -Dclippy::all -Dclippy::pedantic
- run: cd test_suite/no_std && cargo clippy -- -Dclippy::all -Dclippy::pedantic - run: cd test_suite/no_std && cargo clippy -- -Dclippy::all -Dclippy::pedantic
miri:
name: Miri
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@miri
- run: cd serde && cargo miri test --features derive,rc,unstable
env:
MIRIFLAGS: -Zmiri-strict-provenance
- run: cd test_suite && cargo miri test --features unstable
env:
MIRIFLAGS: -Zmiri-strict-provenance
outdated:
name: Outdated
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v3
- uses: dtolnay/install@cargo-outdated
- run: cargo outdated --workspace --exclude macrotest,prettyplease --exit-code 1
+12 -9
View File
@@ -77,17 +77,20 @@ fn main() {
Serde is one of the most widely used Rust libraries so any place that Rustaceans Serde is one of the most widely used Rust libraries so any place that Rustaceans
congregate will be able to help you out. For chat, consider trying the congregate will be able to help you out. For chat, consider trying the
[#general] or [#beginners] channels of the unofficial community Discord, the [#rust-questions] or [#rust-beginners] channels of the unofficial community
[#rust-usage] channel of the official Rust Project Discord, or the Discord (invite: <https://discord.gg/rust-lang-community>), the [#rust-usage] or
[#general][zulip] stream in Zulip. For asynchronous, consider the [\[rust\] tag [#beginners] channels of the official Rust Project Discord (invite:
on StackOverflow][stackoverflow], the [/r/rust] subreddit which has a pinned <https://discord.gg/rust-lang>), or the [#general][zulip] stream in Zulip. For
weekly easy questions post, or the Rust [Discourse forum][discourse]. It's asynchronous, consider the [\[rust\] tag on StackOverflow][stackoverflow], the
acceptable to file a support issue in this repo but they tend not to get as many [/r/rust] subreddit which has a pinned weekly easy questions post, or the Rust
eyes as any of the above and may get closed without a response after some time. [Discourse forum][discourse]. It's acceptable to file a support issue in this
repo but they tend not to get as many eyes as any of the above and may get
closed without a response after some time.
[#general]: https://discord.com/channels/273534239310479360/274215136414400513 [#rust-questions]: https://discord.com/channels/273534239310479360/274215136414400513
[#beginners]: https://discord.com/channels/273534239310479360/273541522815713281 [#rust-beginners]: https://discord.com/channels/273534239310479360/273541522815713281
[#rust-usage]: https://discord.com/channels/442252698964721669/443150878111694848 [#rust-usage]: https://discord.com/channels/442252698964721669/443150878111694848
[#beginners]: https://discord.com/channels/442252698964721669/448238009733742612
[zulip]: https://rust-lang.zulipchat.com/#narrow/stream/122651-general [zulip]: https://rust-lang.zulipchat.com/#narrow/stream/122651-general
[stackoverflow]: https://stackoverflow.com/questions/tagged/rust [stackoverflow]: https://stackoverflow.com/questions/tagged/rust
[/r/rust]: https://www.reddit.com/r/rust [/r/rust]: https://www.reddit.com/r/rust
+12 -9
View File
@@ -45,17 +45,20 @@ fn main() {
Serde is one of the most widely used Rust libraries so any place that Rustaceans Serde is one of the most widely used Rust libraries so any place that Rustaceans
congregate will be able to help you out. For chat, consider trying the congregate will be able to help you out. For chat, consider trying the
[#general] or [#beginners] channels of the unofficial community Discord, the [#rust-questions] or [#rust-beginners] channels of the unofficial community
[#rust-usage] channel of the official Rust Project Discord, or the Discord (invite: <https://discord.gg/rust-lang-community>, the [#rust-usage] or
[#general][zulip] stream in Zulip. For asynchronous, consider the [\[rust\] tag [#beginners] channels of the official Rust Project Discord (invite:
on StackOverflow][stackoverflow], the [/r/rust] subreddit which has a pinned <https://discord.gg/rust-lang>), or the [#general][zulip] stream in Zulip. For
weekly easy questions post, or the Rust [Discourse forum][discourse]. It's asynchronous, consider the [\[rust\] tag on StackOverflow][stackoverflow], the
acceptable to file a support issue in this repo but they tend not to get as many [/r/rust] subreddit which has a pinned weekly easy questions post, or the Rust
eyes as any of the above and may get closed without a response after some time. [Discourse forum][discourse]. It's acceptable to file a support issue in this
repo but they tend not to get as many eyes as any of the above and may get
closed without a response after some time.
[#general]: https://discord.com/channels/273534239310479360/274215136414400513 [#rust-questions]: https://discord.com/channels/273534239310479360/274215136414400513
[#beginners]: https://discord.com/channels/273534239310479360/273541522815713281 [#rust-beginners]: https://discord.com/channels/273534239310479360/273541522815713281
[#rust-usage]: https://discord.com/channels/442252698964721669/443150878111694848 [#rust-usage]: https://discord.com/channels/442252698964721669/443150878111694848
[#beginners]: https://discord.com/channels/442252698964721669/448238009733742612
[zulip]: https://rust-lang.zulipchat.com/#narrow/stream/122651-general [zulip]: https://rust-lang.zulipchat.com/#narrow/stream/122651-general
[stackoverflow]: https://stackoverflow.com/questions/tagged/rust [stackoverflow]: https://stackoverflow.com/questions/tagged/rust
[/r/rust]: https://www.reddit.com/r/rust [/r/rust]: https://www.reddit.com/r/rust
+1
View File
@@ -0,0 +1 @@
msrv = "1.13.0"
+12 -12
View File
@@ -1,21 +1,21 @@
[package] [package]
name = "serde" name = "serde"
version = "1.0.134" # remember to update html_root_url and serde_derive dependency version = "1.0.143" # 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>"]
rust-version = "1.15"
license = "MIT OR Apache-2.0"
description = "A generic serialization/deserialization framework"
homepage = "https://serde.rs"
repository = "https://github.com/serde-rs/serde"
documentation = "https://docs.serde.rs/serde/"
keywords = ["serde", "serialization", "no_std"]
categories = ["encoding"]
readme = "crates-io.md"
include = ["build.rs", "src/**/*.rs", "crates-io.md", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
build = "build.rs" build = "build.rs"
categories = ["encoding", "no-std"]
description = "A generic serialization/deserialization framework"
documentation = "https://docs.serde.rs/serde/"
homepage = "https://serde.rs"
include = ["build.rs", "src/**/*.rs", "crates-io.md", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
keywords = ["serde", "serialization", "no_std"]
license = "MIT OR Apache-2.0"
readme = "crates-io.md"
repository = "https://github.com/serde-rs/serde"
rust-version = "1.13"
[dependencies] [dependencies]
serde_derive = { version = "=1.0.134", optional = true, path = "../serde_derive" } serde_derive = { version = "=1.0.143", 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" }
+30
View File
@@ -0,0 +1,30 @@
use lib::fmt::{self, Write};
use lib::str;
pub struct Buf<'a> {
bytes: &'a mut [u8],
offset: usize,
}
impl<'a> Buf<'a> {
pub fn new(bytes: &'a mut [u8]) -> Self {
Buf { bytes, offset: 0 }
}
pub fn as_str(&self) -> &str {
let slice = &self.bytes[..self.offset];
unsafe { str::from_utf8_unchecked(slice) }
}
}
impl<'a> Write for Buf<'a> {
fn write_str(&mut self, s: &str) -> fmt::Result {
if self.offset + s.len() > self.bytes.len() {
Err(fmt::Error)
} else {
self.bytes[self.offset..self.offset + s.len()].copy_from_slice(s.as_bytes());
self.offset += s.len();
Ok(())
}
}
}
+2 -3
View File
@@ -793,7 +793,6 @@ where
T::deserialize(deserializer).map(Some) T::deserialize(deserializer).map(Some)
} }
#[doc(hidden)]
fn __private_visit_untagged_option<D>(self, deserializer: D) -> Result<Self::Value, ()> fn __private_visit_untagged_option<D>(self, deserializer: D) -> Result<Self::Value, ()>
where where
D: Deserializer<'de>, D: Deserializer<'de>,
@@ -2012,7 +2011,7 @@ impl<'de> Deserialize<'de> for Duration {
b"nanos" => Ok(Field::Nanos), b"nanos" => Ok(Field::Nanos),
_ => { _ => {
let value = ::__private::from_utf8_lossy(value); let value = ::__private::from_utf8_lossy(value);
Err(Error::unknown_field(&value, FIELDS)) Err(Error::unknown_field(&*value, FIELDS))
} }
} }
} }
@@ -2352,7 +2351,7 @@ mod range {
b"end" => Ok(Field::End), b"end" => Ok(Field::End),
_ => { _ => {
let value = ::__private::from_utf8_lossy(value); let value = ::__private::from_utf8_lossy(value);
Err(Error::unknown_field(&value, FIELDS)) Err(Error::unknown_field(&*value, FIELDS))
} }
} }
} }
+22 -11
View File
@@ -30,7 +30,7 @@
//! # The Deserializer trait //! # The Deserializer trait
//! //!
//! [`Deserializer`] implementations are provided by third-party crates, for //! [`Deserializer`] implementations are provided by third-party crates, for
//! example [`serde_json`], [`serde_yaml`] and [`bincode`]. //! example [`serde_json`], [`serde_yaml`] and [`postcard`].
//! //!
//! A partial list of well-maintained formats is given on the [Serde //! A partial list of well-maintained formats is given on the [Serde
//! website][data formats]. //! website][data formats].
@@ -104,7 +104,7 @@
//! [`Deserialize`]: ../trait.Deserialize.html //! [`Deserialize`]: ../trait.Deserialize.html
//! [`Deserializer`]: ../trait.Deserializer.html //! [`Deserializer`]: ../trait.Deserializer.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
//! [`bincode`]: https://github.com/servo/bincode //! [`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
//! [`serde_json`]: https://github.com/serde-rs/json //! [`serde_json`]: https://github.com/serde-rs/json
@@ -118,6 +118,8 @@ use lib::*;
pub mod value; pub mod value;
#[cfg(not(no_integer128))]
mod format;
mod ignored_any; mod ignored_any;
mod impls; mod impls;
mod utf8; mod utf8;
@@ -706,6 +708,11 @@ impl<T> DeserializeOwned for T where T: for<'de> Deserialize<'de> {}
/// where /// where
/// A: SeqAccess<'de>, /// A: SeqAccess<'de>,
/// { /// {
/// // Decrease the number of reallocations if there are many elements
/// if let Some(size_hint) = seq.size_hint() {
/// self.0.reserve(size_hint);
/// }
///
/// // Visit each element in the inner array and push it onto /// // Visit each element in the inner array and push it onto
/// // the existing vector. /// // the existing vector.
/// while let Some(elem) = seq.next_element()? { /// while let Some(elem) = seq.next_element()? {
@@ -867,7 +874,7 @@ where
/// `Deserializer::deserialize_any`. /// `Deserializer::deserialize_any`.
/// ///
/// 2. The various `deserialize_*` methods. Non-self-describing formats like /// 2. The various `deserialize_*` methods. Non-self-describing formats like
/// Bincode need to be told what is in the input in order to deserialize it. /// Postcard need to be told what is in the input in order to deserialize it.
/// The `deserialize_*` methods are hints to the deserializer for how to /// The `deserialize_*` methods are hints to the deserializer for how to
/// interpret the next piece of input. Non-self-describing formats are not /// interpret the next piece of input. Non-self-describing formats are not
/// able to deserialize something like `serde_json::Value` which relies on /// able to deserialize something like `serde_json::Value` which relies on
@@ -877,7 +884,7 @@ where
/// `Deserializer::deserialize_any` unless you need to be told by the /// `Deserializer::deserialize_any` unless you need to be told by the
/// Deserializer what type is in the input. Know that relying on /// Deserializer what type is in the input. Know that relying on
/// `Deserializer::deserialize_any` means your data type will be able to /// `Deserializer::deserialize_any` means your data type will be able to
/// deserialize from self-describing formats only, ruling out Bincode and many /// deserialize from self-describing formats only, ruling out Postcard and many
/// others. /// others.
/// ///
/// [Serde data model]: https://serde.rs/data-model.html /// [Serde data model]: https://serde.rs/data-model.html
@@ -908,7 +915,7 @@ pub trait Deserializer<'de>: Sized {
/// `Deserializer::deserialize_any` unless you need to be told by the /// `Deserializer::deserialize_any` unless you need to be told by the
/// Deserializer what type is in the input. Know that relying on /// Deserializer what type is in the input. Know that relying on
/// `Deserializer::deserialize_any` means your data type will be able to /// `Deserializer::deserialize_any` means your data type will be able to
/// deserialize from self-describing formats only, ruling out Bincode and /// deserialize from self-describing formats only, ruling out Postcard and
/// many others. /// many others.
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error> fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
where where
@@ -1149,7 +1156,7 @@ pub trait Deserializer<'de>: Sized {
/// Some types have a human-readable form that may be somewhat expensive to /// Some types have a human-readable form that may be somewhat expensive to
/// construct, as well as a binary form that is compact and efficient. /// construct, as well as a binary form that is compact and efficient.
/// Generally text-based formats like JSON and YAML will prefer to use the /// Generally text-based formats like JSON and YAML will prefer to use the
/// human-readable one and binary formats like Bincode will prefer the /// human-readable one and binary formats like Postcard will prefer the
/// compact one. /// compact one.
/// ///
/// ```edition2018 /// ```edition2018
@@ -1366,8 +1373,10 @@ pub trait Visitor<'de>: Sized {
where where
E: Error, E: Error,
{ {
let _ = v; let mut buf = [0u8; 58];
Err(Error::invalid_type(Unexpected::Other("i128"), &self)) let mut writer = format::Buf::new(&mut buf);
fmt::Write::write_fmt(&mut writer, format_args!("integer `{}` as i128", v)).unwrap();
Err(Error::invalid_type(Unexpected::Other(writer.as_str()), &self))
} }
} }
@@ -1426,8 +1435,10 @@ pub trait Visitor<'de>: Sized {
where where
E: Error, E: Error,
{ {
let _ = v; let mut buf = [0u8; 57];
Err(Error::invalid_type(Unexpected::Other("u128"), &self)) let mut writer = format::Buf::new(&mut buf);
fmt::Write::write_fmt(&mut writer, format_args!("integer `{}` as u128", v)).unwrap();
Err(Error::invalid_type(Unexpected::Other(writer.as_str()), &self))
} }
} }
@@ -1549,7 +1560,7 @@ pub trait Visitor<'de>: Sized {
/// `Deserializer`. /// `Deserializer`.
/// ///
/// This enables zero-copy deserialization of bytes in some formats. For /// This enables zero-copy deserialization of bytes in some formats. For
/// example Bincode data containing bytes can be deserialized with zero /// example Postcard data containing bytes can be deserialized with zero
/// copying into a `&'a [u8]` as long as the input data outlives `'a`. /// copying into a `&'a [u8]` as long as the input data outlives `'a`.
/// ///
/// The default implementation forwards to `visit_bytes`. /// The default implementation forwards to `visit_bytes`.
+53 -9
View File
@@ -128,9 +128,7 @@ where
type Deserializer = UnitDeserializer<E>; type Deserializer = UnitDeserializer<E>;
fn into_deserializer(self) -> UnitDeserializer<E> { fn into_deserializer(self) -> UnitDeserializer<E> {
UnitDeserializer { UnitDeserializer::new()
marker: PhantomData,
}
} }
} }
@@ -141,6 +139,15 @@ pub struct UnitDeserializer<E> {
impl_copy_clone!(UnitDeserializer); impl_copy_clone!(UnitDeserializer);
impl<E> UnitDeserializer<E> {
#[allow(missing_docs)]
pub fn new() -> Self {
UnitDeserializer {
marker: PhantomData,
}
}
}
impl<'de, E> de::Deserializer<'de> for UnitDeserializer<E> impl<'de, E> de::Deserializer<'de> for UnitDeserializer<E>
where where
E: de::Error, E: de::Error,
@@ -236,8 +243,15 @@ macro_rules! primitive_deserializer {
type Deserializer = $name<E>; type Deserializer = $name<E>;
fn into_deserializer(self) -> $name<E> { fn into_deserializer(self) -> $name<E> {
$name::new(self)
}
}
impl<E> $name<E> {
#[allow(missing_docs)]
pub fn new(value: $ty) -> Self {
$name { $name {
value: self, value: value,
marker: PhantomData, marker: PhantomData,
} }
} }
@@ -308,8 +322,15 @@ where
type Deserializer = U32Deserializer<E>; type Deserializer = U32Deserializer<E>;
fn into_deserializer(self) -> U32Deserializer<E> { fn into_deserializer(self) -> U32Deserializer<E> {
U32Deserializer::new(self)
}
}
impl<E> U32Deserializer<E> {
#[allow(missing_docs)]
pub fn new(value: u32) -> Self {
U32Deserializer { U32Deserializer {
value: self, value: value,
marker: PhantomData, marker: PhantomData,
} }
} }
@@ -390,8 +411,15 @@ where
type Deserializer = StrDeserializer<'a, E>; type Deserializer = StrDeserializer<'a, E>;
fn into_deserializer(self) -> StrDeserializer<'a, E> { fn into_deserializer(self) -> StrDeserializer<'a, E> {
StrDeserializer::new(self)
}
}
impl<'a, E> StrDeserializer<'a, E> {
#[allow(missing_docs)]
pub fn new(value: &'a str) -> Self {
StrDeserializer { StrDeserializer {
value: self, value: value,
marker: PhantomData, marker: PhantomData,
} }
} }
@@ -561,8 +589,16 @@ where
type Deserializer = StringDeserializer<E>; type Deserializer = StringDeserializer<E>;
fn into_deserializer(self) -> StringDeserializer<E> { fn into_deserializer(self) -> StringDeserializer<E> {
StringDeserializer::new(self)
}
}
#[cfg(any(feature = "std", feature = "alloc"))]
impl<E> StringDeserializer<E> {
#[allow(missing_docs)]
pub fn new(value: String) -> Self {
StringDeserializer { StringDeserializer {
value: self, value: value,
marker: PhantomData, marker: PhantomData,
} }
} }
@@ -604,7 +640,7 @@ where
} }
#[cfg(any(feature = "std", feature = "alloc"))] #[cfg(any(feature = "std", feature = "alloc"))]
impl<'de, 'a, E> de::EnumAccess<'de> for StringDeserializer<E> impl<'de, E> de::EnumAccess<'de> for StringDeserializer<E>
where where
E: de::Error, E: de::Error,
{ {
@@ -656,8 +692,16 @@ where
type Deserializer = CowStrDeserializer<'a, E>; type Deserializer = CowStrDeserializer<'a, E>;
fn into_deserializer(self) -> CowStrDeserializer<'a, E> { fn into_deserializer(self) -> CowStrDeserializer<'a, E> {
CowStrDeserializer::new(self)
}
}
#[cfg(any(feature = "std", feature = "alloc"))]
impl<'a, E> CowStrDeserializer<'a, E> {
#[allow(missing_docs)]
pub fn new(value: Cow<'a, str>) -> Self {
CowStrDeserializer { CowStrDeserializer {
value: self, value: value,
marker: PhantomData, marker: PhantomData,
} }
} }
+9 -11
View File
@@ -31,8 +31,7 @@
//! for Serde by the community. //! for Serde by the community.
//! //!
//! - [JSON], the ubiquitous JavaScript Object Notation used by many HTTP APIs. //! - [JSON], the ubiquitous JavaScript Object Notation used by many HTTP APIs.
//! - [Bincode], a compact binary format //! - [Postcard], a no\_std and embedded-systems friendly compact binary format.
//! used for IPC within the Servo rendering engine.
//! - [CBOR], a Concise Binary Object Representation designed for small message //! - [CBOR], a Concise Binary Object Representation designed for small message
//! size without the need for version negotiation. //! size without the need for version negotiation.
//! - [YAML], a self-proclaimed human-friendly configuration language that ain't //! - [YAML], a self-proclaimed human-friendly configuration language that ain't
@@ -45,7 +44,6 @@
//! - [Avro], a binary format used within Apache Hadoop, with support for schema //! - [Avro], a binary format used within Apache Hadoop, with support for schema
//! definition. //! definition.
//! - [JSON5], a superset of JSON including some productions from ES5. //! - [JSON5], a superset of JSON including some productions from ES5.
//! - [Postcard], a no\_std and embedded-systems friendly compact binary format.
//! - [URL] query strings, in the x-www-form-urlencoded format. //! - [URL] query strings, in the x-www-form-urlencoded format.
//! - [Envy], a way to deserialize environment variables into Rust structs. //! - [Envy], a way to deserialize environment variables into Rust structs.
//! *(deserialization only)* //! *(deserialization only)*
@@ -59,22 +57,21 @@
//! and from DynamoDB. //! and from DynamoDB.
//! //!
//! [JSON]: https://github.com/serde-rs/json //! [JSON]: https://github.com/serde-rs/json
//! [Bincode]: https://github.com/servo/bincode //! [Postcard]: https://github.com/jamesmunns/postcard
//! [CBOR]: https://github.com/enarx/ciborium //! [CBOR]: https://github.com/enarx/ciborium
//! [YAML]: https://github.com/dtolnay/serde-yaml //! [YAML]: https://github.com/dtolnay/serde-yaml
//! [MessagePack]: https://github.com/3Hren/msgpack-rust //! [MessagePack]: https://github.com/3Hren/msgpack-rust
//! [TOML]: https://github.com/alexcrichton/toml-rs //! [TOML]: https://github.com/alexcrichton/toml-rs
//! [Pickle]: https://github.com/birkenfeld/serde-pickle //! [Pickle]: https://github.com/birkenfeld/serde-pickle
//! [RON]: https://github.com/ron-rs/ron //! [RON]: https://github.com/ron-rs/ron
//! [BSON]: https://github.com/zonyitoo/bson-rs //! [BSON]: https://github.com/mongodb/bson-rust
//! [Avro]: https://github.com/flavray/avro-rs //! [Avro]: https://github.com/flavray/avro-rs
//! [JSON5]: https://github.com/callum-oakley/json5-rs //! [JSON5]: https://github.com/callum-oakley/json5-rs
//! [Postcard]: https://github.com/jamesmunns/postcard
//! [URL]: https://docs.rs/serde_qs //! [URL]: https://docs.rs/serde_qs
//! [Envy]: https://github.com/softprops/envy //! [Envy]: https://github.com/softprops/envy
//! [Envy Store]: https://github.com/softprops/envy-store //! [Envy Store]: https://github.com/softprops/envy-store
//! [Cargo]: https://doc.rust-lang.org/cargo/reference/manifest.html //! [Cargo]: https://doc.rust-lang.org/cargo/reference/manifest.html
//! [AWS Parameter Store]: https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html //! [AWS Parameter Store]: https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html
//! [S-expressions]: https://github.com/rotty/lexpr-rs //! [S-expressions]: https://github.com/rotty/lexpr-rs
//! [D-Bus]: https://docs.rs/zvariant //! [D-Bus]: https://docs.rs/zvariant
//! [FlexBuffers]: https://github.com/google/flatbuffers/tree/master/rust/flexbuffers //! [FlexBuffers]: https://github.com/google/flatbuffers/tree/master/rust/flexbuffers
@@ -84,7 +81,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.134")] #![doc(html_root_url = "https://docs.rs/serde/1.0.143")]
// 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
@@ -103,10 +100,8 @@
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/7768 // clippy bug: https://github.com/rust-lang/rust-clippy/issues/7768
semicolon_if_nothing_returned, semicolon_if_nothing_returned,
// not available in our oldest supported compiler // not available in our oldest supported compiler
checked_conversions,
empty_enum, empty_enum,
redundant_field_names, type_repetition_in_bounds, // https://github.com/rust-lang/rust-clippy/issues/8772
redundant_static_lifetimes,
// integer and float ser/de requires these sorts of casts // integer and float ser/de requires these sorts of casts
cast_possible_truncation, cast_possible_truncation,
cast_possible_wrap, cast_possible_wrap,
@@ -120,9 +115,12 @@
use_self, use_self,
zero_prefixed_literal, zero_prefixed_literal,
// correctly used // correctly used
derive_partial_eq_without_eq,
enum_glob_use, enum_glob_use,
explicit_auto_deref,
let_underscore_drop, let_underscore_drop,
map_err_ignore, map_err_ignore,
new_without_default,
result_unit_err, result_unit_err,
wildcard_imports, wildcard_imports,
// not practical // not practical
+4 -4
View File
@@ -30,7 +30,7 @@
//! # The Serializer trait //! # The Serializer trait
//! //!
//! [`Serializer`] implementations are provided by third-party crates, for //! [`Serializer`] implementations are provided by third-party crates, for
//! example [`serde_json`], [`serde_yaml`] and [`bincode`]. //! example [`serde_json`], [`serde_yaml`] and [`postcard`].
//! //!
//! A partial list of well-maintained formats is given on the [Serde //! A partial list of well-maintained formats is given on the [Serde
//! website][data formats]. //! website][data formats].
@@ -99,7 +99,7 @@
//! [`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`]: ../trait.Serialize.html
//! [`Serializer`]: ../trait.Serializer.html //! [`Serializer`]: ../trait.Serializer.html
//! [`bincode`]: https://github.com/servo/bincode //! [`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
//! [`serde_json`]: https://github.com/serde-rs/json //! [`serde_json`]: https://github.com/serde-rs/json
@@ -314,7 +314,7 @@ pub trait Serialize {
/// - For example the `E::S` in `enum E { S { r: u8, g: u8, b: u8 } }`. /// - For example the `E::S` in `enum E { S { r: u8, g: u8, b: u8 } }`.
/// ///
/// Many Serde serializers produce text or binary data as output, for example /// Many Serde serializers produce text or binary data as output, for example
/// JSON or Bincode. This is not a requirement of the `Serializer` trait, and /// JSON or Postcard. This is not a requirement of the `Serializer` trait, and
/// there are serializers that do not produce text or binary output. One example /// there are serializers that do not produce text or binary output. One example
/// is the `serde_json::value::Serializer` (distinct from the main `serde_json` /// is the `serde_json::value::Serializer` (distinct from the main `serde_json`
/// serializer) that produces a `serde_json::Value` data structure in memory as /// serializer) that produces a `serde_json::Value` data structure in memory as
@@ -1423,7 +1423,7 @@ pub trait Serializer: Sized {
/// Some types have a human-readable form that may be somewhat expensive to /// Some types have a human-readable form that may be somewhat expensive to
/// construct, as well as a binary form that is compact and efficient. /// construct, as well as a binary form that is compact and efficient.
/// Generally text-based formats like JSON and YAML will prefer to use the /// Generally text-based formats like JSON and YAML will prefer to use the
/// human-readable one and binary formats like Bincode will prefer the /// human-readable one and binary formats like Postcard will prefer the
/// compact one. /// compact one.
/// ///
/// ```edition2018 /// ```edition2018
+1
View File
@@ -0,0 +1 @@
msrv = "1.31.0"
+9 -8
View File
@@ -1,16 +1,17 @@
[package] [package]
name = "serde_derive" name = "serde_derive"
version = "1.0.134" # remember to update html_root_url version = "1.0.143" # 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>"]
rust-version = "1.31" categories = ["no-std"]
license = "MIT OR Apache-2.0"
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]" description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
homepage = "https://serde.rs"
repository = "https://github.com/serde-rs/serde"
documentation = "https://serde.rs/derive.html" documentation = "https://serde.rs/derive.html"
keywords = ["serde", "serialization", "no_std"] homepage = "https://serde.rs"
readme = "crates-io.md"
include = ["build.rs", "src/**/*.rs", "crates-io.md", "README.md", "LICENSE-APACHE", "LICENSE-MIT"] include = ["build.rs", "src/**/*.rs", "crates-io.md", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
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.31"
[features] [features]
default = [] default = []
@@ -23,7 +24,7 @@ proc-macro = true
[dependencies] [dependencies]
proc-macro2 = "1.0" proc-macro2 = "1.0"
quote = "1.0" quote = "1.0"
syn = "1.0.60" syn = "1.0.90"
[dev-dependencies] [dev-dependencies]
serde = { version = "1.0", path = "../serde" } serde = { version = "1.0", path = "../serde" }
+4 -4
View File
@@ -13,14 +13,14 @@ fn main() {
// Underscore const names stabilized in Rust 1.37: // Underscore const names stabilized in Rust 1.37:
// https://blog.rust-lang.org/2019/08/15/Rust-1.37.0.html#using-unnamed-const-items-for-macros // https://blog.rust-lang.org/2019/08/15/Rust-1.37.0.html#using-unnamed-const-items-for-macros
if minor >= 37 { if minor < 37 {
println!("cargo:rustc-cfg=underscore_consts"); println!("cargo:rustc-cfg=no_underscore_consts");
} }
// The ptr::addr_of! macro stabilized in Rust 1.51: // The ptr::addr_of! macro stabilized in Rust 1.51:
// https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#stabilized-apis // https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#stabilized-apis
if minor >= 51 { if minor < 51 {
println!("cargo:rustc-cfg=ptr_addr_of"); println!("cargo:rustc-cfg=no_ptr_addr_of");
} }
} }
+1 -3
View File
@@ -184,9 +184,7 @@ pub fn with_bound(
syn::Type::Infer(_) | syn::Type::Never(_) | syn::Type::Verbatim(_) => {} syn::Type::Infer(_) | syn::Type::Never(_) | syn::Type::Verbatim(_) => {}
#[cfg(test)] #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
syn::Type::__TestExhaustive(_) => unimplemented!(),
#[cfg(not(test))]
_ => {} _ => {}
} }
} }
+3 -3
View File
@@ -12,10 +12,10 @@ pub fn wrap_in_const(
) -> TokenStream { ) -> TokenStream {
let try_replacement = try::replacement(); let try_replacement = try::replacement();
let dummy_const = if cfg!(underscore_consts) { let dummy_const = if cfg!(no_underscore_consts) {
format_ident!("_")
} else {
format_ident!("_IMPL_{}_FOR_{}", trait_, unraw(ty)) format_ident!("_IMPL_{}_FOR_{}", trait_, unraw(ty))
} else {
format_ident!("_")
}; };
let use_serde = match serde_path { let use_serde = match serde_path {
+1 -3
View File
@@ -1912,9 +1912,7 @@ fn collect_lifetimes(ty: &syn::Type, out: &mut BTreeSet<syn::Lifetime>) {
| syn::Type::Infer(_) | syn::Type::Infer(_)
| syn::Type::Verbatim(_) => {} | syn::Type::Verbatim(_) => {}
#[cfg(test)] #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
syn::Type::__TestExhaustive(_) => unimplemented!(),
#[cfg(not(test))]
_ => {} _ => {}
} }
} }
+1 -3
View File
@@ -147,9 +147,7 @@ impl ReplaceReceiver<'_> {
Type::Infer(_) | Type::Never(_) | Type::Verbatim(_) => {} Type::Infer(_) | Type::Never(_) | Type::Verbatim(_) => {}
#[cfg(test)] #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))]
Type::__TestExhaustive(_) => unimplemented!(),
#[cfg(not(test))]
_ => {} _ => {}
} }
} }
+3 -1
View File
@@ -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.134")] #![doc(html_root_url = "https://docs.rs/serde_derive/1.0.143")]
#![allow(unknown_lints, bare_trait_objects)] #![allow(unknown_lints, bare_trait_objects)]
// Ignored clippy lints // Ignored clippy lints
#![allow( #![allow(
@@ -22,6 +22,7 @@
clippy::cognitive_complexity, clippy::cognitive_complexity,
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/7575 // clippy bug: https://github.com/rust-lang/rust-clippy/issues/7575
clippy::collapsible_match, clippy::collapsible_match,
clippy::derive_partial_eq_without_eq,
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,
@@ -60,6 +61,7 @@
clippy::use_self, clippy::use_self,
clippy::wildcard_imports clippy::wildcard_imports
)] )]
#![cfg_attr(all(test, exhaustive), feature(non_exhaustive_omitted_patterns_lint))]
#[macro_use] #[macro_use]
extern crate quote; extern crate quote;
+2 -2
View File
@@ -97,7 +97,7 @@ fn pretend_fields_used_struct_packed(cont: &Container, fields: &[Field]) -> Toke
let members = fields.iter().map(|field| &field.member).collect::<Vec<_>>(); let members = fields.iter().map(|field| &field.member).collect::<Vec<_>>();
#[cfg(ptr_addr_of)] #[cfg(not(no_ptr_addr_of))]
{ {
quote! { quote! {
match _serde::__private::None::<&#type_ident #ty_generics> { match _serde::__private::None::<&#type_ident #ty_generics> {
@@ -111,7 +111,7 @@ fn pretend_fields_used_struct_packed(cont: &Container, fields: &[Field]) -> Toke
} }
} }
#[cfg(not(ptr_addr_of))] #[cfg(no_ptr_addr_of)]
{ {
let placeholders = (0usize..).map(|i| format_ident!("__v{}", i)); let placeholders = (0usize..).map(|i| format_ident!("__v{}", i));
+1
View File
@@ -0,0 +1 @@
msrv = "1.31.0"
+6 -6
View File
@@ -2,14 +2,14 @@
name = "serde_derive_internals" name = "serde_derive_internals"
version = "0.26.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>"]
rust-version = "1.31"
license = "MIT OR Apache-2.0"
description = "AST representation used by Serde derive macros. Unstable." description = "AST representation used by Serde derive macros. Unstable."
homepage = "https://serde.rs"
repository = "https://github.com/serde-rs/serde"
documentation = "https://docs.rs/serde_derive_internals" documentation = "https://docs.rs/serde_derive_internals"
keywords = ["serde", "serialization"] homepage = "https://serde.rs"
include = ["lib.rs", "src/**/*.rs", "LICENSE-APACHE", "LICENSE-MIT"] include = ["lib.rs", "src/**/*.rs", "LICENSE-APACHE", "LICENSE-MIT"]
keywords = ["serde", "serialization"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/serde-rs/serde"
rust-version = "1.31"
[lib] [lib]
path = "lib.rs" path = "lib.rs"
@@ -17,7 +17,7 @@ path = "lib.rs"
[dependencies] [dependencies]
proc-macro2 = "1.0" proc-macro2 = "1.0"
quote = "1.0" quote = "1.0"
syn = { version = "1.0.60", default-features = false, features = ["derive", "parsing", "printing", "clone-impls"] } syn = { version = "1.0.90", default-features = false, features = ["derive", "parsing", "printing", "clone-impls"] }
[package.metadata.docs.rs] [package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"] targets = ["x86_64-unknown-linux-gnu"]
+1
View File
@@ -5,6 +5,7 @@
clippy::cognitive_complexity, clippy::cognitive_complexity,
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/7575 // clippy bug: https://github.com/rust-lang/rust-clippy/issues/7575
clippy::collapsible_match, clippy::collapsible_match,
clippy::derive_partial_eq_without_eq,
// 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,
+1
View File
@@ -0,0 +1 @@
msrv = "1.13.0"
+11 -10
View File
@@ -1,17 +1,18 @@
[package] [package]
name = "serde_test" name = "serde_test"
version = "1.0.134" # remember to update html_root_url version = "1.0.143" # 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>"]
rust-version = "1.15"
license = "MIT OR Apache-2.0"
description = "Token De/Serializer for testing De/Serialize implementations"
homepage = "https://serde.rs"
repository = "https://github.com/serde-rs/serde"
documentation = "https://docs.serde.rs/serde_test/"
keywords = ["serde", "serialization"]
readme = "crates-io.md"
include = ["build.rs", "src/**/*.rs", "crates-io.md", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
build = "build.rs" build = "build.rs"
categories = ["development-tools::testing"]
description = "Token De/Serializer for testing De/Serialize implementations"
documentation = "https://docs.serde.rs/serde_test/"
homepage = "https://serde.rs"
include = ["build.rs", "src/**/*.rs", "crates-io.md", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
keywords = ["serde", "serialization", "testing"]
license = "MIT OR Apache-2.0"
readme = "crates-io.md"
repository = "https://github.com/serde-rs/serde"
rust-version = "1.13"
[dependencies] [dependencies]
serde = { version = "1.0.60", path = "../serde" } serde = { version = "1.0.60", path = "../serde" }
+2 -2
View File
@@ -13,8 +13,8 @@ fn main() {
// #[track_caller] stabilized in Rust 1.46: // #[track_caller] stabilized in Rust 1.46:
// https://blog.rust-lang.org/2020/08/27/Rust-1.46.0.html#track_caller // https://blog.rust-lang.org/2020/08/27/Rust-1.46.0.html#track_caller
if minor >= 46 { if minor < 46 {
println!("cargo:rustc-cfg=track_caller"); println!("cargo:rustc-cfg=no_track_caller");
} }
} }
+5 -5
View File
@@ -28,7 +28,7 @@ use std::fmt::Debug;
/// Token::StructEnd, /// Token::StructEnd,
/// ]); /// ]);
/// ``` /// ```
#[cfg_attr(track_caller, track_caller)] #[cfg_attr(not(no_track_caller), track_caller)]
pub fn assert_tokens<'de, T>(value: &T, tokens: &'de [Token]) pub fn assert_tokens<'de, T>(value: &T, tokens: &'de [Token])
where where
T: Serialize + Deserialize<'de> + PartialEq + Debug, T: Serialize + Deserialize<'de> + PartialEq + Debug,
@@ -59,7 +59,7 @@ where
/// Token::StructEnd, /// Token::StructEnd,
/// ]); /// ]);
/// ``` /// ```
#[cfg_attr(track_caller, track_caller)] #[cfg_attr(not(no_track_caller), track_caller)]
pub fn assert_ser_tokens<T: ?Sized>(value: &T, tokens: &[Token]) pub fn assert_ser_tokens<T: ?Sized>(value: &T, tokens: &[Token])
where where
T: Serialize, T: Serialize,
@@ -112,7 +112,7 @@ where
/// assert_ser_tokens_error(&example, expected, error); /// assert_ser_tokens_error(&example, expected, error);
/// } /// }
/// ``` /// ```
#[cfg_attr(track_caller, track_caller)] #[cfg_attr(not(no_track_caller), track_caller)]
pub fn assert_ser_tokens_error<T: ?Sized>(value: &T, tokens: &[Token], error: &str) pub fn assert_ser_tokens_error<T: ?Sized>(value: &T, tokens: &[Token], error: &str)
where where
T: Serialize, T: Serialize,
@@ -150,7 +150,7 @@ where
/// Token::StructEnd, /// Token::StructEnd,
/// ]); /// ]);
/// ``` /// ```
#[cfg_attr(track_caller, track_caller)] #[cfg_attr(not(no_track_caller), track_caller)]
pub fn assert_de_tokens<'de, T>(value: &T, tokens: &'de [Token]) pub fn assert_de_tokens<'de, T>(value: &T, tokens: &'de [Token])
where where
T: Deserialize<'de> + PartialEq + Debug, T: Deserialize<'de> + PartialEq + Debug,
@@ -203,7 +203,7 @@ where
/// "unknown field `x`, expected `a` or `b`", /// "unknown field `x`, expected `a` or `b`",
/// ); /// );
/// ``` /// ```
#[cfg_attr(track_caller, track_caller)] #[cfg_attr(not(no_track_caller), track_caller)]
pub fn assert_de_tokens_error<'de, T>(tokens: &'de [Token], error: &str) pub fn assert_de_tokens_error<'de, T>(tokens: &'de [Token], error: &str)
where where
T: Deserialize<'de>, T: Deserialize<'de>,
+3 -1
View File
@@ -144,7 +144,7 @@
//! # } //! # }
//! ``` //! ```
#![doc(html_root_url = "https://docs.rs/serde_test/1.0.134")] #![doc(html_root_url = "https://docs.rs/serde_test/1.0.143")]
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))] #![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
// Ignored clippy lints // Ignored clippy lints
#![cfg_attr(feature = "cargo-clippy", allow(float_cmp, needless_doctest_main))] #![cfg_attr(feature = "cargo-clippy", allow(float_cmp, needless_doctest_main))]
@@ -153,6 +153,7 @@
feature = "cargo-clippy", feature = "cargo-clippy",
allow( allow(
cloned_instead_of_copied, cloned_instead_of_copied,
doc_link_with_quotes, // https://github.com/rust-lang/rust-clippy/issues/8961
empty_line_after_outer_attr, empty_line_after_outer_attr,
manual_assert, manual_assert,
missing_docs_in_private_items, missing_docs_in_private_items,
@@ -161,6 +162,7 @@
must_use_candidate, must_use_candidate,
redundant_field_names, redundant_field_names,
too_many_lines, too_many_lines,
type_repetition_in_bounds, // https://github.com/rust-lang/rust-clippy/issues/8772
use_debug, use_debug,
use_self use_self
) )
+4 -3
View File
@@ -2,9 +2,9 @@
name = "serde_test_suite" name = "serde_test_suite"
version = "0.0.0" version = "0.0.0"
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"
edition = "2018" edition = "2018"
publish = false publish = false
build = "build.rs"
[features] [features]
expandtest = [] expandtest = []
@@ -14,11 +14,12 @@ unstable = ["serde/unstable"]
serde = { path = "../serde" } serde = { path = "../serde" }
[build-dependencies] [build-dependencies]
toolchain_find = "0.1" toolchain_find = "0.2"
[dev-dependencies] [dev-dependencies]
fnv = "1.0" fnv = "1.0"
macrotest = "=1.0.0" macrotest = "=1.0.9"
prettyplease = "=0.1.14"
rustversion = "1.0" rustversion = "1.0"
serde = { path = "../serde", features = ["rc", "derive"] } serde = { path = "../serde", features = ["rc", "derive"] }
serde_derive = { path = "../serde_derive", features = ["deserialize_in_place"] } serde_derive = { path = "../serde_derive", features = ["deserialize_in_place"] }
+1 -5
View File
@@ -18,12 +18,8 @@ fn has_cargo_expand() -> bool {
.unwrap_or(false) .unwrap_or(false)
} }
fn has_rustfmt() -> bool {
toolchain_find::find_installed_component("rustfmt").is_some()
}
fn main() { fn main() {
if cfg!(feature = "expandtest") && has_cargo_expand() && has_rustfmt() { if cfg!(feature = "expandtest") && has_cargo_expand() {
println!("cargo:rustc-cfg=expandtest"); println!("cargo:rustc-cfg=expandtest");
} }
} }
+1
View File
@@ -1,6 +1,7 @@
[package] [package]
name = "serde_derive_tests_no_std" name = "serde_derive_tests_no_std"
version = "0.0.0" version = "0.0.0"
authors = ["David Tolnay <dtolnay@gmail.com>"]
edition = "2018" edition = "2018"
publish = false publish = false
+2
View File
@@ -1,5 +1,7 @@
#[cfg_attr(target_os = "emscripten", ignore)] #[cfg_attr(target_os = "emscripten", ignore)]
#[rustversion::attr(not(nightly), ignore)] #[rustversion::attr(not(nightly), ignore)]
#[cfg_attr(miri, ignore)]
#[allow(unused_attributes)]
#[test] #[test]
fn ui() { fn ui() {
let t = trybuild::TestCases::new(); let t = trybuild::TestCases::new();
+161 -172
View File
@@ -28,7 +28,12 @@ const _: () = {
{ {
match *self { match *self {
DeEnum::Unit => { DeEnum::Unit => {
_serde::Serializer::serialize_unit_variant(__serializer, "DeEnum", 0u32, "Unit") _serde::Serializer::serialize_unit_variant(
__serializer,
"DeEnum",
0u32,
"Unit",
)
} }
DeEnum::Seq(ref __field0, ref __field1, ref __field2, ref __field3) => { DeEnum::Seq(ref __field0, ref __field1, ref __field2, ref __field3) => {
let mut __serde_state = match _serde::Serializer::serialize_tuple_variant( let mut __serde_state = match _serde::Serializer::serialize_tuple_variant(
@@ -81,12 +86,7 @@ const _: () = {
}; };
_serde::ser::SerializeTupleVariant::end(__serde_state) _serde::ser::SerializeTupleVariant::end(__serde_state)
} }
DeEnum::Map { DeEnum::Map { ref a, ref b, ref c, ref d } => {
ref a,
ref b,
ref c,
ref d,
} => {
let mut __serde_state = match _serde::Serializer::serialize_struct_variant( let mut __serde_state = match _serde::Serializer::serialize_struct_variant(
__serializer, __serializer,
"DeEnum", "DeEnum",
@@ -141,13 +141,20 @@ const _: () = {
}; };
_serde::ser::SerializeStructVariant::end(__serde_state) _serde::ser::SerializeStructVariant::end(__serde_state)
} }
DeEnum::_Unit2 => _serde::Serializer::serialize_unit_variant( DeEnum::_Unit2 => {
__serializer, _serde::Serializer::serialize_unit_variant(
"DeEnum", __serializer,
3u32, "DeEnum",
"_Unit2", 3u32,
), "_Unit2",
DeEnum::_Seq2(ref __field0, ref __field1, ref __field2, ref __field3) => { )
}
DeEnum::_Seq2(
ref __field0,
ref __field1,
ref __field2,
ref __field3,
) => {
let mut __serde_state = match _serde::Serializer::serialize_tuple_variant( let mut __serde_state = match _serde::Serializer::serialize_tuple_variant(
__serializer, __serializer,
"DeEnum", "DeEnum",
@@ -198,12 +205,7 @@ const _: () = {
}; };
_serde::ser::SerializeTupleVariant::end(__serde_state) _serde::ser::SerializeTupleVariant::end(__serde_state)
} }
DeEnum::_Map2 { DeEnum::_Map2 { ref a, ref b, ref c, ref d } => {
ref a,
ref b,
ref c,
ref d,
} => {
let mut __serde_state = match _serde::Serializer::serialize_struct_variant( let mut __serde_state = match _serde::Serializer::serialize_struct_variant(
__serializer, __serializer,
"DeEnum", "DeEnum",
@@ -274,7 +276,9 @@ const _: () = {
C: _serde::Deserialize<'de>, C: _serde::Deserialize<'de>,
D: _serde::Deserialize<'de>, D: _serde::Deserialize<'de>,
{ {
fn deserialize<__D>(__deserializer: __D) -> _serde::__private::Result<Self, __D::Error> fn deserialize<__D>(
__deserializer: __D,
) -> _serde::__private::Result<Self, __D::Error>
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
@@ -294,9 +298,15 @@ const _: () = {
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "variant identifier") _serde::__private::Formatter::write_str(
__formatter,
"variant identifier",
)
} }
fn visit_u64<__E>(self, __value: u64) -> _serde::__private::Result<Self::Value, __E> fn visit_u64<__E>(
self,
__value: u64,
) -> _serde::__private::Result<Self::Value, __E>
where where
__E: _serde::de::Error, __E: _serde::de::Error,
{ {
@@ -307,10 +317,14 @@ const _: () = {
3u64 => _serde::__private::Ok(__Field::__field3), 3u64 => _serde::__private::Ok(__Field::__field3),
4u64 => _serde::__private::Ok(__Field::__field4), 4u64 => _serde::__private::Ok(__Field::__field4),
5u64 => _serde::__private::Ok(__Field::__field5), 5u64 => _serde::__private::Ok(__Field::__field5),
_ => _serde::__private::Err(_serde::de::Error::invalid_value( _ => {
_serde::de::Unexpected::Unsigned(__value), _serde::__private::Err(
&"variant index 0 <= i < 6", _serde::de::Error::invalid_value(
)), _serde::de::Unexpected::Unsigned(__value),
&"variant index 0 <= i < 6",
),
)
}
} }
} }
fn visit_str<__E>( fn visit_str<__E>(
@@ -327,9 +341,11 @@ const _: () = {
"_Unit2" => _serde::__private::Ok(__Field::__field3), "_Unit2" => _serde::__private::Ok(__Field::__field3),
"_Seq2" => _serde::__private::Ok(__Field::__field4), "_Seq2" => _serde::__private::Ok(__Field::__field4),
"_Map2" => _serde::__private::Ok(__Field::__field5), "_Map2" => _serde::__private::Ok(__Field::__field5),
_ => _serde::__private::Err(_serde::de::Error::unknown_variant( _ => {
__value, VARIANTS, _serde::__private::Err(
)), _serde::de::Error::unknown_variant(__value, VARIANTS),
)
}
} }
} }
fn visit_bytes<__E>( fn visit_bytes<__E>(
@@ -348,9 +364,9 @@ const _: () = {
b"_Map2" => _serde::__private::Ok(__Field::__field5), b"_Map2" => _serde::__private::Ok(__Field::__field5),
_ => { _ => {
let __value = &_serde::__private::from_utf8_lossy(__value); let __value = &_serde::__private::from_utf8_lossy(__value);
_serde::__private::Err(_serde::de::Error::unknown_variant( _serde::__private::Err(
__value, VARIANTS, _serde::de::Error::unknown_variant(__value, VARIANTS),
)) )
} }
} }
} }
@@ -363,7 +379,10 @@ const _: () = {
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
_serde::Deserializer::deserialize_identifier(__deserializer, __FieldVisitor) _serde::Deserializer::deserialize_identifier(
__deserializer,
__FieldVisitor,
)
} }
} }
struct __Visitor<'de, B, C, D> struct __Visitor<'de, B, C, D>
@@ -420,7 +439,8 @@ const _: () = {
marker: _serde::__private::PhantomData<DeEnum<B, C, D>>, marker: _serde::__private::PhantomData<DeEnum<B, C, D>>,
lifetime: _serde::__private::PhantomData<&'de ()>, lifetime: _serde::__private::PhantomData<&'de ()>,
} }
impl<'de, B, C, D> _serde::de::Visitor<'de> for __Visitor<'de, B, C, D> impl<'de, B, C, D> _serde::de::Visitor<'de>
for __Visitor<'de, B, C, D>
where where
B: _serde::Deserialize<'de>, B: _serde::Deserialize<'de>,
C: _serde::Deserialize<'de>, C: _serde::Deserialize<'de>,
@@ -430,8 +450,7 @@ const _: () = {
fn expecting( fn expecting(
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result ) -> _serde::__private::fmt::Result {
{
_serde::__private::Formatter::write_str( _serde::__private::Formatter::write_str(
__formatter, __formatter,
"tuple variant DeEnum::Seq", "tuple variant DeEnum::Seq",
@@ -447,9 +466,7 @@ const _: () = {
{ {
let __field0 = match match _serde::de::SeqAccess::next_element::< let __field0 = match match _serde::de::SeqAccess::next_element::<
i8, i8,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -467,9 +484,7 @@ const _: () = {
}; };
let __field1 = match match _serde::de::SeqAccess::next_element::< let __field1 = match match _serde::de::SeqAccess::next_element::<
B, B,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -487,9 +502,7 @@ const _: () = {
}; };
let __field2 = match match _serde::de::SeqAccess::next_element::< let __field2 = match match _serde::de::SeqAccess::next_element::<
C, C,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -507,9 +520,7 @@ const _: () = {
}; };
let __field3 = match match _serde::de::SeqAccess::next_element::< let __field3 = match match _serde::de::SeqAccess::next_element::<
D, D,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -525,9 +536,9 @@ const _: () = {
); );
} }
}; };
_serde::__private::Ok(DeEnum::Seq( _serde::__private::Ok(
__field0, __field1, __field2, __field3, DeEnum::Seq(__field0, __field1, __field2, __field3),
)) )
} }
} }
_serde::de::VariantAccess::tuple_variant( _serde::de::VariantAccess::tuple_variant(
@@ -554,8 +565,7 @@ const _: () = {
fn expecting( fn expecting(
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result ) -> _serde::__private::fmt::Result {
{
_serde::__private::Formatter::write_str( _serde::__private::Formatter::write_str(
__formatter, __formatter,
"field identifier", "field identifier",
@@ -630,7 +640,8 @@ const _: () = {
marker: _serde::__private::PhantomData<DeEnum<B, C, D>>, marker: _serde::__private::PhantomData<DeEnum<B, C, D>>,
lifetime: _serde::__private::PhantomData<&'de ()>, lifetime: _serde::__private::PhantomData<&'de ()>,
} }
impl<'de, B, C, D> _serde::de::Visitor<'de> for __Visitor<'de, B, C, D> impl<'de, B, C, D> _serde::de::Visitor<'de>
for __Visitor<'de, B, C, D>
where where
B: _serde::Deserialize<'de>, B: _serde::Deserialize<'de>,
C: _serde::Deserialize<'de>, C: _serde::Deserialize<'de>,
@@ -640,8 +651,7 @@ const _: () = {
fn expecting( fn expecting(
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result ) -> _serde::__private::fmt::Result {
{
_serde::__private::Formatter::write_str( _serde::__private::Formatter::write_str(
__formatter, __formatter,
"struct variant DeEnum::Map", "struct variant DeEnum::Map",
@@ -657,9 +667,7 @@ const _: () = {
{ {
let __field0 = match match _serde::de::SeqAccess::next_element::< let __field0 = match match _serde::de::SeqAccess::next_element::<
i8, i8,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -677,9 +685,7 @@ const _: () = {
}; };
let __field1 = match match _serde::de::SeqAccess::next_element::< let __field1 = match match _serde::de::SeqAccess::next_element::<
B, B,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -697,9 +703,7 @@ const _: () = {
}; };
let __field2 = match match _serde::de::SeqAccess::next_element::< let __field2 = match match _serde::de::SeqAccess::next_element::<
C, C,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -717,9 +721,7 @@ const _: () = {
}; };
let __field3 = match match _serde::de::SeqAccess::next_element::< let __field3 = match match _serde::de::SeqAccess::next_element::<
D, D,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -750,32 +752,28 @@ const _: () = {
where where
__A: _serde::de::MapAccess<'de>, __A: _serde::de::MapAccess<'de>,
{ {
let mut __field0: _serde::__private::Option<i8> = let mut __field0: _serde::__private::Option<i8> = _serde::__private::None;
_serde::__private::None; let mut __field1: _serde::__private::Option<B> = _serde::__private::None;
let mut __field1: _serde::__private::Option<B> = let mut __field2: _serde::__private::Option<C> = _serde::__private::None;
_serde::__private::None; let mut __field3: _serde::__private::Option<D> = _serde::__private::None;
let mut __field2: _serde::__private::Option<C> = while let _serde::__private::Some(__key)
_serde::__private::None; = match _serde::de::MapAccess::next_key::<
let mut __field3: _serde::__private::Option<D> = __Field,
_serde::__private::None; >(&mut __map) {
while let _serde::__private::Some(__key) =
match _serde::de::MapAccess::next_key::<__Field>(&mut __map)
{
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
} } {
{
match __key { match __key {
__Field::__field0 => { __Field::__field0 => {
if _serde::__private::Option::is_some(&__field0) { if _serde::__private::Option::is_some(&__field0) {
return _serde :: __private :: Err (< __A :: Error as _serde :: de :: Error > :: duplicate_field ("a")) ; return _serde::__private::Err(
<__A::Error as _serde::de::Error>::duplicate_field("a"),
);
} }
__field0 = _serde::__private::Some( __field0 = _serde::__private::Some(
match _serde::de::MapAccess::next_value::<i8>( match _serde::de::MapAccess::next_value::<i8>(&mut __map) {
&mut __map,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -785,12 +783,12 @@ const _: () = {
} }
__Field::__field1 => { __Field::__field1 => {
if _serde::__private::Option::is_some(&__field1) { if _serde::__private::Option::is_some(&__field1) {
return _serde :: __private :: Err (< __A :: Error as _serde :: de :: Error > :: duplicate_field ("b")) ; return _serde::__private::Err(
<__A::Error as _serde::de::Error>::duplicate_field("b"),
);
} }
__field1 = _serde::__private::Some( __field1 = _serde::__private::Some(
match _serde::de::MapAccess::next_value::<B>( match _serde::de::MapAccess::next_value::<B>(&mut __map) {
&mut __map,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -800,12 +798,12 @@ const _: () = {
} }
__Field::__field2 => { __Field::__field2 => {
if _serde::__private::Option::is_some(&__field2) { if _serde::__private::Option::is_some(&__field2) {
return _serde :: __private :: Err (< __A :: Error as _serde :: de :: Error > :: duplicate_field ("c")) ; return _serde::__private::Err(
<__A::Error as _serde::de::Error>::duplicate_field("c"),
);
} }
__field2 = _serde::__private::Some( __field2 = _serde::__private::Some(
match _serde::de::MapAccess::next_value::<C>( match _serde::de::MapAccess::next_value::<C>(&mut __map) {
&mut __map,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -815,12 +813,12 @@ const _: () = {
} }
__Field::__field3 => { __Field::__field3 => {
if _serde::__private::Option::is_some(&__field3) { if _serde::__private::Option::is_some(&__field3) {
return _serde :: __private :: Err (< __A :: Error as _serde :: de :: Error > :: duplicate_field ("d")) ; return _serde::__private::Err(
<__A::Error as _serde::de::Error>::duplicate_field("d"),
);
} }
__field3 = _serde::__private::Some( __field3 = _serde::__private::Some(
match _serde::de::MapAccess::next_value::<D>( match _serde::de::MapAccess::next_value::<D>(&mut __map) {
&mut __map,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -831,9 +829,7 @@ const _: () = {
_ => { _ => {
let _ = match _serde::de::MapAccess::next_value::< let _ = match _serde::de::MapAccess::next_value::<
_serde::de::IgnoredAny, _serde::de::IgnoredAny,
>( >(&mut __map) {
&mut __map
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -894,7 +890,12 @@ const _: () = {
}) })
} }
} }
const FIELDS: &'static [&'static str] = &["a", "b", "c", "d"]; const FIELDS: &'static [&'static str] = &[
"a",
"b",
"c",
"d",
];
_serde::de::VariantAccess::struct_variant( _serde::de::VariantAccess::struct_variant(
__variant, __variant,
FIELDS, FIELDS,
@@ -923,7 +924,8 @@ const _: () = {
marker: _serde::__private::PhantomData<DeEnum<B, C, D>>, marker: _serde::__private::PhantomData<DeEnum<B, C, D>>,
lifetime: _serde::__private::PhantomData<&'de ()>, lifetime: _serde::__private::PhantomData<&'de ()>,
} }
impl<'de, B, C, D> _serde::de::Visitor<'de> for __Visitor<'de, B, C, D> impl<'de, B, C, D> _serde::de::Visitor<'de>
for __Visitor<'de, B, C, D>
where where
B: _serde::Deserialize<'de>, B: _serde::Deserialize<'de>,
C: _serde::Deserialize<'de>, C: _serde::Deserialize<'de>,
@@ -933,8 +935,7 @@ const _: () = {
fn expecting( fn expecting(
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result ) -> _serde::__private::fmt::Result {
{
_serde::__private::Formatter::write_str( _serde::__private::Formatter::write_str(
__formatter, __formatter,
"tuple variant DeEnum::_Seq2", "tuple variant DeEnum::_Seq2",
@@ -950,9 +951,7 @@ const _: () = {
{ {
let __field0 = match match _serde::de::SeqAccess::next_element::< let __field0 = match match _serde::de::SeqAccess::next_element::<
i8, i8,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -970,9 +969,7 @@ const _: () = {
}; };
let __field1 = match match _serde::de::SeqAccess::next_element::< let __field1 = match match _serde::de::SeqAccess::next_element::<
B, B,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -990,9 +987,7 @@ const _: () = {
}; };
let __field2 = match match _serde::de::SeqAccess::next_element::< let __field2 = match match _serde::de::SeqAccess::next_element::<
C, C,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -1010,9 +1005,7 @@ const _: () = {
}; };
let __field3 = match match _serde::de::SeqAccess::next_element::< let __field3 = match match _serde::de::SeqAccess::next_element::<
D, D,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -1028,9 +1021,9 @@ const _: () = {
); );
} }
}; };
_serde::__private::Ok(DeEnum::_Seq2( _serde::__private::Ok(
__field0, __field1, __field2, __field3, DeEnum::_Seq2(__field0, __field1, __field2, __field3),
)) )
} }
} }
_serde::de::VariantAccess::tuple_variant( _serde::de::VariantAccess::tuple_variant(
@@ -1057,8 +1050,7 @@ const _: () = {
fn expecting( fn expecting(
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result ) -> _serde::__private::fmt::Result {
{
_serde::__private::Formatter::write_str( _serde::__private::Formatter::write_str(
__formatter, __formatter,
"field identifier", "field identifier",
@@ -1133,7 +1125,8 @@ const _: () = {
marker: _serde::__private::PhantomData<DeEnum<B, C, D>>, marker: _serde::__private::PhantomData<DeEnum<B, C, D>>,
lifetime: _serde::__private::PhantomData<&'de ()>, lifetime: _serde::__private::PhantomData<&'de ()>,
} }
impl<'de, B, C, D> _serde::de::Visitor<'de> for __Visitor<'de, B, C, D> impl<'de, B, C, D> _serde::de::Visitor<'de>
for __Visitor<'de, B, C, D>
where where
B: _serde::Deserialize<'de>, B: _serde::Deserialize<'de>,
C: _serde::Deserialize<'de>, C: _serde::Deserialize<'de>,
@@ -1143,8 +1136,7 @@ const _: () = {
fn expecting( fn expecting(
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result ) -> _serde::__private::fmt::Result {
{
_serde::__private::Formatter::write_str( _serde::__private::Formatter::write_str(
__formatter, __formatter,
"struct variant DeEnum::_Map2", "struct variant DeEnum::_Map2",
@@ -1160,9 +1152,7 @@ const _: () = {
{ {
let __field0 = match match _serde::de::SeqAccess::next_element::< let __field0 = match match _serde::de::SeqAccess::next_element::<
i8, i8,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -1180,9 +1170,7 @@ const _: () = {
}; };
let __field1 = match match _serde::de::SeqAccess::next_element::< let __field1 = match match _serde::de::SeqAccess::next_element::<
B, B,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -1200,9 +1188,7 @@ const _: () = {
}; };
let __field2 = match match _serde::de::SeqAccess::next_element::< let __field2 = match match _serde::de::SeqAccess::next_element::<
C, C,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -1220,9 +1206,7 @@ const _: () = {
}; };
let __field3 = match match _serde::de::SeqAccess::next_element::< let __field3 = match match _serde::de::SeqAccess::next_element::<
D, D,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -1253,32 +1237,28 @@ const _: () = {
where where
__A: _serde::de::MapAccess<'de>, __A: _serde::de::MapAccess<'de>,
{ {
let mut __field0: _serde::__private::Option<i8> = let mut __field0: _serde::__private::Option<i8> = _serde::__private::None;
_serde::__private::None; let mut __field1: _serde::__private::Option<B> = _serde::__private::None;
let mut __field1: _serde::__private::Option<B> = let mut __field2: _serde::__private::Option<C> = _serde::__private::None;
_serde::__private::None; let mut __field3: _serde::__private::Option<D> = _serde::__private::None;
let mut __field2: _serde::__private::Option<C> = while let _serde::__private::Some(__key)
_serde::__private::None; = match _serde::de::MapAccess::next_key::<
let mut __field3: _serde::__private::Option<D> = __Field,
_serde::__private::None; >(&mut __map) {
while let _serde::__private::Some(__key) =
match _serde::de::MapAccess::next_key::<__Field>(&mut __map)
{
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
} } {
{
match __key { match __key {
__Field::__field0 => { __Field::__field0 => {
if _serde::__private::Option::is_some(&__field0) { if _serde::__private::Option::is_some(&__field0) {
return _serde :: __private :: Err (< __A :: Error as _serde :: de :: Error > :: duplicate_field ("a")) ; return _serde::__private::Err(
<__A::Error as _serde::de::Error>::duplicate_field("a"),
);
} }
__field0 = _serde::__private::Some( __field0 = _serde::__private::Some(
match _serde::de::MapAccess::next_value::<i8>( match _serde::de::MapAccess::next_value::<i8>(&mut __map) {
&mut __map,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -1288,12 +1268,12 @@ const _: () = {
} }
__Field::__field1 => { __Field::__field1 => {
if _serde::__private::Option::is_some(&__field1) { if _serde::__private::Option::is_some(&__field1) {
return _serde :: __private :: Err (< __A :: Error as _serde :: de :: Error > :: duplicate_field ("b")) ; return _serde::__private::Err(
<__A::Error as _serde::de::Error>::duplicate_field("b"),
);
} }
__field1 = _serde::__private::Some( __field1 = _serde::__private::Some(
match _serde::de::MapAccess::next_value::<B>( match _serde::de::MapAccess::next_value::<B>(&mut __map) {
&mut __map,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -1303,12 +1283,12 @@ const _: () = {
} }
__Field::__field2 => { __Field::__field2 => {
if _serde::__private::Option::is_some(&__field2) { if _serde::__private::Option::is_some(&__field2) {
return _serde :: __private :: Err (< __A :: Error as _serde :: de :: Error > :: duplicate_field ("c")) ; return _serde::__private::Err(
<__A::Error as _serde::de::Error>::duplicate_field("c"),
);
} }
__field2 = _serde::__private::Some( __field2 = _serde::__private::Some(
match _serde::de::MapAccess::next_value::<C>( match _serde::de::MapAccess::next_value::<C>(&mut __map) {
&mut __map,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -1318,12 +1298,12 @@ const _: () = {
} }
__Field::__field3 => { __Field::__field3 => {
if _serde::__private::Option::is_some(&__field3) { if _serde::__private::Option::is_some(&__field3) {
return _serde :: __private :: Err (< __A :: Error as _serde :: de :: Error > :: duplicate_field ("d")) ; return _serde::__private::Err(
<__A::Error as _serde::de::Error>::duplicate_field("d"),
);
} }
__field3 = _serde::__private::Some( __field3 = _serde::__private::Some(
match _serde::de::MapAccess::next_value::<D>( match _serde::de::MapAccess::next_value::<D>(&mut __map) {
&mut __map,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -1334,9 +1314,7 @@ const _: () = {
_ => { _ => {
let _ = match _serde::de::MapAccess::next_value::< let _ = match _serde::de::MapAccess::next_value::<
_serde::de::IgnoredAny, _serde::de::IgnoredAny,
>( >(&mut __map) {
&mut __map
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -1397,7 +1375,12 @@ const _: () = {
}) })
} }
} }
const FIELDS: &'static [&'static str] = &["a", "b", "c", "d"]; const FIELDS: &'static [&'static str] = &[
"a",
"b",
"c",
"d",
];
_serde::de::VariantAccess::struct_variant( _serde::de::VariantAccess::struct_variant(
__variant, __variant,
FIELDS, FIELDS,
@@ -1410,8 +1393,14 @@ const _: () = {
} }
} }
} }
const VARIANTS: &'static [&'static str] = const VARIANTS: &'static [&'static str] = &[
&["Unit", "Seq", "Map", "_Unit2", "_Seq2", "_Map2"]; "Unit",
"Seq",
"Map",
"_Unit2",
"_Seq2",
"_Map2",
];
_serde::Deserializer::deserialize_enum( _serde::Deserializer::deserialize_enum(
__deserializer, __deserializer,
"DeEnum", "DeEnum",
+93 -55
View File
@@ -52,8 +52,11 @@ const _: () = {
#[allow(unused_extern_crates, 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>
fn deserialize<__D>(__deserializer: __D) -> _serde::__private::Result<Self, __D::Error> for DefaultTyParam<T> {
fn deserialize<__D>(
__deserializer: __D,
) -> _serde::__private::Result<Self, __D::Error>
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
@@ -69,9 +72,15 @@ const _: () = {
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "field identifier") _serde::__private::Formatter::write_str(
__formatter,
"field identifier",
)
} }
fn visit_u64<__E>(self, __value: u64) -> _serde::__private::Result<Self::Value, __E> fn visit_u64<__E>(
self,
__value: u64,
) -> _serde::__private::Result<Self::Value, __E>
where where
__E: _serde::de::Error, __E: _serde::de::Error,
{ {
@@ -113,20 +122,27 @@ const _: () = {
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
_serde::Deserializer::deserialize_identifier(__deserializer, __FieldVisitor) _serde::Deserializer::deserialize_identifier(
__deserializer,
__FieldVisitor,
)
} }
} }
struct __Visitor<'de, T: AssociatedType<X = i32>> { struct __Visitor<'de, T: AssociatedType<X = i32>> {
marker: _serde::__private::PhantomData<DefaultTyParam<T>>, marker: _serde::__private::PhantomData<DefaultTyParam<T>>,
lifetime: _serde::__private::PhantomData<&'de ()>, lifetime: _serde::__private::PhantomData<&'de ()>,
} }
impl<'de, T: AssociatedType<X = i32>> _serde::de::Visitor<'de> for __Visitor<'de, T> { impl<'de, T: AssociatedType<X = i32>> _serde::de::Visitor<'de>
for __Visitor<'de, T> {
type Value = DefaultTyParam<T>; type Value = DefaultTyParam<T>;
fn expecting( fn expecting(
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "struct DefaultTyParam") _serde::__private::Formatter::write_str(
__formatter,
"struct DefaultTyParam",
)
} }
#[inline] #[inline]
fn visit_seq<__A>( fn visit_seq<__A>(
@@ -136,9 +152,9 @@ const _: () = {
where where
__A: _serde::de::SeqAccess<'de>, __A: _serde::de::SeqAccess<'de>,
{ {
let __field0 = match match _serde::de::SeqAccess::next_element::<PhantomData<T>>( let __field0 = match match _serde::de::SeqAccess::next_element::<
&mut __seq, PhantomData<T>,
) { >(&mut __seq) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -146,13 +162,17 @@ const _: () = {
} { } {
_serde::__private::Some(__value) => __value, _serde::__private::Some(__value) => __value,
_serde::__private::None => { _serde::__private::None => {
return _serde::__private::Err(_serde::de::Error::invalid_length( return _serde::__private::Err(
0usize, _serde::de::Error::invalid_length(
&"struct DefaultTyParam with 1 element", 0usize,
)); &"struct DefaultTyParam with 1 element",
),
);
} }
}; };
_serde::__private::Ok(DefaultTyParam { phantom: __field0 }) _serde::__private::Ok(DefaultTyParam {
phantom: __field0,
})
} }
#[inline] #[inline]
fn visit_map<__A>( fn visit_map<__A>(
@@ -162,16 +182,14 @@ const _: () = {
where where
__A: _serde::de::MapAccess<'de>, __A: _serde::de::MapAccess<'de>,
{ {
let mut __field0: _serde::__private::Option<PhantomData<T>> = let mut __field0: _serde::__private::Option<PhantomData<T>> = _serde::__private::None;
_serde::__private::None; while let _serde::__private::Some(__key)
while let _serde::__private::Some(__key) = = match _serde::de::MapAccess::next_key::<__Field>(&mut __map) {
match _serde::de::MapAccess::next_key::<__Field>(&mut __map) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
} } {
{
match __key { match __key {
__Field::__field0 => { __Field::__field0 => {
if _serde::__private::Option::is_some(&__field0) { if _serde::__private::Option::is_some(&__field0) {
@@ -182,9 +200,9 @@ const _: () = {
); );
} }
__field0 = _serde::__private::Some( __field0 = _serde::__private::Some(
match _serde::de::MapAccess::next_value::<PhantomData<T>>( match _serde::de::MapAccess::next_value::<
&mut __map, PhantomData<T>,
) { >(&mut __map) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -195,8 +213,7 @@ const _: () = {
_ => { _ => {
let _ = match _serde::de::MapAccess::next_value::< let _ = match _serde::de::MapAccess::next_value::<
_serde::de::IgnoredAny, _serde::de::IgnoredAny,
>(&mut __map) >(&mut __map) {
{
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -216,7 +233,9 @@ const _: () = {
} }
} }
}; };
_serde::__private::Ok(DefaultTyParam { phantom: __field0 }) _serde::__private::Ok(DefaultTyParam {
phantom: __field0,
})
} }
} }
const FIELDS: &'static [&'static str] = &["phantom"]; const FIELDS: &'static [&'static str] = &["phantom"];
@@ -249,9 +268,15 @@ const _: () = {
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "field identifier") _serde::__private::Formatter::write_str(
__formatter,
"field identifier",
)
} }
fn visit_u64<__E>(self, __value: u64) -> _serde::__private::Result<Self::Value, __E> fn visit_u64<__E>(
self,
__value: u64,
) -> _serde::__private::Result<Self::Value, __E>
where where
__E: _serde::de::Error, __E: _serde::de::Error,
{ {
@@ -293,22 +318,30 @@ const _: () = {
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
_serde::Deserializer::deserialize_identifier(__deserializer, __FieldVisitor) _serde::Deserializer::deserialize_identifier(
__deserializer,
__FieldVisitor,
)
} }
} }
struct __Visitor<'de, 'place, T: AssociatedType<X = i32> + 'place> { struct __Visitor<'de, 'place, T: AssociatedType<X = i32> + 'place> {
place: &'place mut DefaultTyParam<T>, place: &'place mut DefaultTyParam<T>,
lifetime: _serde::__private::PhantomData<&'de ()>, lifetime: _serde::__private::PhantomData<&'de ()>,
} }
impl<'de, 'place, T: AssociatedType<X = i32> + 'place> _serde::de::Visitor<'de> impl<
for __Visitor<'de, 'place, T> 'de,
{ 'place,
T: AssociatedType<X = i32> + 'place,
> _serde::de::Visitor<'de> for __Visitor<'de, 'place, T> {
type Value = (); type Value = ();
fn expecting( fn expecting(
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "struct DefaultTyParam") _serde::__private::Formatter::write_str(
__formatter,
"struct DefaultTyParam",
)
} }
#[inline] #[inline]
fn visit_seq<__A>( fn visit_seq<__A>(
@@ -318,19 +351,22 @@ const _: () = {
where where
__A: _serde::de::SeqAccess<'de>, __A: _serde::de::SeqAccess<'de>,
{ {
if let _serde::__private::None = match _serde::de::SeqAccess::next_element_seed( if let _serde::__private::None
&mut __seq, = match _serde::de::SeqAccess::next_element_seed(
_serde::__private::de::InPlaceSeed(&mut self.place.phantom), &mut __seq,
) { _serde::__private::de::InPlaceSeed(&mut self.place.phantom),
_serde::__private::Ok(__val) => __val, ) {
_serde::__private::Err(__err) => { _serde::__private::Ok(__val) => __val,
return _serde::__private::Err(__err); _serde::__private::Err(__err) => {
} return _serde::__private::Err(__err);
} { }
return _serde::__private::Err(_serde::de::Error::invalid_length( } {
0usize, return _serde::__private::Err(
&"struct DefaultTyParam with 1 element", _serde::de::Error::invalid_length(
)); 0usize,
&"struct DefaultTyParam with 1 element",
),
);
} }
_serde::__private::Ok(()) _serde::__private::Ok(())
} }
@@ -343,14 +379,13 @@ const _: () = {
__A: _serde::de::MapAccess<'de>, __A: _serde::de::MapAccess<'de>,
{ {
let mut __field0: bool = false; let mut __field0: bool = false;
while let _serde::__private::Some(__key) = while let _serde::__private::Some(__key)
match _serde::de::MapAccess::next_key::<__Field>(&mut __map) { = match _serde::de::MapAccess::next_key::<__Field>(&mut __map) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
} } {
{
match __key { match __key {
__Field::__field0 => { __Field::__field0 => {
if __field0 { if __field0 {
@@ -374,8 +409,7 @@ const _: () = {
_ => { _ => {
let _ = match _serde::de::MapAccess::next_value::< let _ = match _serde::de::MapAccess::next_value::<
_serde::de::IgnoredAny, _serde::de::IgnoredAny,
>(&mut __map) >(&mut __map) {
{
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -385,13 +419,17 @@ const _: () = {
} }
} }
if !__field0 { if !__field0 {
self.place.phantom = match _serde::__private::de::missing_field("phantom") { self
.place
.phantom = match _serde::__private::de::missing_field(
"phantom",
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
}; };
}; }
_serde::__private::Ok(()) _serde::__private::Ok(())
} }
} }
+100 -69
View File
@@ -24,12 +24,14 @@ const _: () = {
__S: _serde::Serializer, __S: _serde::Serializer,
{ {
match *self { match *self {
GenericEnum::Unit => _serde::Serializer::serialize_unit_variant( GenericEnum::Unit => {
__serializer, _serde::Serializer::serialize_unit_variant(
"GenericEnum", __serializer,
0u32, "GenericEnum",
"Unit", 0u32,
), "Unit",
)
}
GenericEnum::NewType(ref __field0) => { GenericEnum::NewType(ref __field0) => {
_serde::Serializer::serialize_newtype_variant( _serde::Serializer::serialize_newtype_variant(
__serializer, __serializer,
@@ -122,7 +124,9 @@ const _: () = {
T: _serde::Deserialize<'de>, T: _serde::Deserialize<'de>,
U: _serde::Deserialize<'de>, U: _serde::Deserialize<'de>,
{ {
fn deserialize<__D>(__deserializer: __D) -> _serde::__private::Result<Self, __D::Error> fn deserialize<__D>(
__deserializer: __D,
) -> _serde::__private::Result<Self, __D::Error>
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
@@ -140,9 +144,15 @@ const _: () = {
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "variant identifier") _serde::__private::Formatter::write_str(
__formatter,
"variant identifier",
)
} }
fn visit_u64<__E>(self, __value: u64) -> _serde::__private::Result<Self::Value, __E> fn visit_u64<__E>(
self,
__value: u64,
) -> _serde::__private::Result<Self::Value, __E>
where where
__E: _serde::de::Error, __E: _serde::de::Error,
{ {
@@ -151,10 +161,14 @@ const _: () = {
1u64 => _serde::__private::Ok(__Field::__field1), 1u64 => _serde::__private::Ok(__Field::__field1),
2u64 => _serde::__private::Ok(__Field::__field2), 2u64 => _serde::__private::Ok(__Field::__field2),
3u64 => _serde::__private::Ok(__Field::__field3), 3u64 => _serde::__private::Ok(__Field::__field3),
_ => _serde::__private::Err(_serde::de::Error::invalid_value( _ => {
_serde::de::Unexpected::Unsigned(__value), _serde::__private::Err(
&"variant index 0 <= i < 4", _serde::de::Error::invalid_value(
)), _serde::de::Unexpected::Unsigned(__value),
&"variant index 0 <= i < 4",
),
)
}
} }
} }
fn visit_str<__E>( fn visit_str<__E>(
@@ -169,9 +183,11 @@ const _: () = {
"NewType" => _serde::__private::Ok(__Field::__field1), "NewType" => _serde::__private::Ok(__Field::__field1),
"Seq" => _serde::__private::Ok(__Field::__field2), "Seq" => _serde::__private::Ok(__Field::__field2),
"Map" => _serde::__private::Ok(__Field::__field3), "Map" => _serde::__private::Ok(__Field::__field3),
_ => _serde::__private::Err(_serde::de::Error::unknown_variant( _ => {
__value, VARIANTS, _serde::__private::Err(
)), _serde::de::Error::unknown_variant(__value, VARIANTS),
)
}
} }
} }
fn visit_bytes<__E>( fn visit_bytes<__E>(
@@ -188,9 +204,9 @@ const _: () = {
b"Map" => _serde::__private::Ok(__Field::__field3), b"Map" => _serde::__private::Ok(__Field::__field3),
_ => { _ => {
let __value = &_serde::__private::from_utf8_lossy(__value); let __value = &_serde::__private::from_utf8_lossy(__value);
_serde::__private::Err(_serde::de::Error::unknown_variant( _serde::__private::Err(
__value, VARIANTS, _serde::de::Error::unknown_variant(__value, VARIANTS),
)) )
} }
} }
} }
@@ -203,7 +219,10 @@ const _: () = {
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
_serde::Deserializer::deserialize_identifier(__deserializer, __FieldVisitor) _serde::Deserializer::deserialize_identifier(
__deserializer,
__FieldVisitor,
)
} }
} }
struct __Visitor<'de, T, U> struct __Visitor<'de, T, U>
@@ -224,7 +243,10 @@ const _: () = {
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "enum GenericEnum") _serde::__private::Formatter::write_str(
__formatter,
"enum GenericEnum",
)
} }
fn visit_enum<__A>( fn visit_enum<__A>(
self, self,
@@ -248,10 +270,12 @@ const _: () = {
}; };
_serde::__private::Ok(GenericEnum::Unit) _serde::__private::Ok(GenericEnum::Unit)
} }
(__Field::__field1, __variant) => _serde::__private::Result::map( (__Field::__field1, __variant) => {
_serde::de::VariantAccess::newtype_variant::<T>(__variant), _serde::__private::Result::map(
GenericEnum::NewType, _serde::de::VariantAccess::newtype_variant::<T>(__variant),
), GenericEnum::NewType,
)
}
(__Field::__field2, __variant) => { (__Field::__field2, __variant) => {
struct __Visitor<'de, T, U> struct __Visitor<'de, T, U>
where where
@@ -261,7 +285,8 @@ const _: () = {
marker: _serde::__private::PhantomData<GenericEnum<T, U>>, marker: _serde::__private::PhantomData<GenericEnum<T, U>>,
lifetime: _serde::__private::PhantomData<&'de ()>, lifetime: _serde::__private::PhantomData<&'de ()>,
} }
impl<'de, T, U> _serde::de::Visitor<'de> for __Visitor<'de, T, U> impl<'de, T, U> _serde::de::Visitor<'de>
for __Visitor<'de, T, U>
where where
T: _serde::Deserialize<'de>, T: _serde::Deserialize<'de>,
U: _serde::Deserialize<'de>, U: _serde::Deserialize<'de>,
@@ -270,8 +295,7 @@ const _: () = {
fn expecting( fn expecting(
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result ) -> _serde::__private::fmt::Result {
{
_serde::__private::Formatter::write_str( _serde::__private::Formatter::write_str(
__formatter, __formatter,
"tuple variant GenericEnum::Seq", "tuple variant GenericEnum::Seq",
@@ -287,9 +311,7 @@ const _: () = {
{ {
let __field0 = match match _serde::de::SeqAccess::next_element::< let __field0 = match match _serde::de::SeqAccess::next_element::<
T, T,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -297,14 +319,17 @@ const _: () = {
} { } {
_serde::__private::Some(__value) => __value, _serde::__private::Some(__value) => __value,
_serde::__private::None => { _serde::__private::None => {
return _serde :: __private :: Err (_serde :: de :: Error :: invalid_length (0usize , & "tuple variant GenericEnum::Seq with 2 elements")) ; return _serde::__private::Err(
_serde::de::Error::invalid_length(
0usize,
&"tuple variant GenericEnum::Seq with 2 elements",
),
);
} }
}; };
let __field1 = match match _serde::de::SeqAccess::next_element::< let __field1 = match match _serde::de::SeqAccess::next_element::<
U, U,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -312,7 +337,12 @@ const _: () = {
} { } {
_serde::__private::Some(__value) => __value, _serde::__private::Some(__value) => __value,
_serde::__private::None => { _serde::__private::None => {
return _serde :: __private :: Err (_serde :: de :: Error :: invalid_length (1usize , & "tuple variant GenericEnum::Seq with 2 elements")) ; return _serde::__private::Err(
_serde::de::Error::invalid_length(
1usize,
&"tuple variant GenericEnum::Seq with 2 elements",
),
);
} }
}; };
_serde::__private::Ok(GenericEnum::Seq(__field0, __field1)) _serde::__private::Ok(GenericEnum::Seq(__field0, __field1))
@@ -340,8 +370,7 @@ const _: () = {
fn expecting( fn expecting(
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result ) -> _serde::__private::fmt::Result {
{
_serde::__private::Formatter::write_str( _serde::__private::Formatter::write_str(
__formatter, __formatter,
"field identifier", "field identifier",
@@ -409,7 +438,8 @@ const _: () = {
marker: _serde::__private::PhantomData<GenericEnum<T, U>>, marker: _serde::__private::PhantomData<GenericEnum<T, U>>,
lifetime: _serde::__private::PhantomData<&'de ()>, lifetime: _serde::__private::PhantomData<&'de ()>,
} }
impl<'de, T, U> _serde::de::Visitor<'de> for __Visitor<'de, T, U> impl<'de, T, U> _serde::de::Visitor<'de>
for __Visitor<'de, T, U>
where where
T: _serde::Deserialize<'de>, T: _serde::Deserialize<'de>,
U: _serde::Deserialize<'de>, U: _serde::Deserialize<'de>,
@@ -418,8 +448,7 @@ const _: () = {
fn expecting( fn expecting(
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result ) -> _serde::__private::fmt::Result {
{
_serde::__private::Formatter::write_str( _serde::__private::Formatter::write_str(
__formatter, __formatter,
"struct variant GenericEnum::Map", "struct variant GenericEnum::Map",
@@ -435,9 +464,7 @@ const _: () = {
{ {
let __field0 = match match _serde::de::SeqAccess::next_element::< let __field0 = match match _serde::de::SeqAccess::next_element::<
T, T,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -445,14 +472,17 @@ const _: () = {
} { } {
_serde::__private::Some(__value) => __value, _serde::__private::Some(__value) => __value,
_serde::__private::None => { _serde::__private::None => {
return _serde :: __private :: Err (_serde :: de :: Error :: invalid_length (0usize , & "struct variant GenericEnum::Map with 2 elements")) ; return _serde::__private::Err(
_serde::de::Error::invalid_length(
0usize,
&"struct variant GenericEnum::Map with 2 elements",
),
);
} }
}; };
let __field1 = match match _serde::de::SeqAccess::next_element::< let __field1 = match match _serde::de::SeqAccess::next_element::<
U, U,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -460,7 +490,12 @@ const _: () = {
} { } {
_serde::__private::Some(__value) => __value, _serde::__private::Some(__value) => __value,
_serde::__private::None => { _serde::__private::None => {
return _serde :: __private :: Err (_serde :: de :: Error :: invalid_length (1usize , & "struct variant GenericEnum::Map with 2 elements")) ; return _serde::__private::Err(
_serde::de::Error::invalid_length(
1usize,
&"struct variant GenericEnum::Map with 2 elements",
),
);
} }
}; };
_serde::__private::Ok(GenericEnum::Map { _serde::__private::Ok(GenericEnum::Map {
@@ -476,28 +511,26 @@ const _: () = {
where where
__A: _serde::de::MapAccess<'de>, __A: _serde::de::MapAccess<'de>,
{ {
let mut __field0: _serde::__private::Option<T> = let mut __field0: _serde::__private::Option<T> = _serde::__private::None;
_serde::__private::None; let mut __field1: _serde::__private::Option<U> = _serde::__private::None;
let mut __field1: _serde::__private::Option<U> = while let _serde::__private::Some(__key)
_serde::__private::None; = match _serde::de::MapAccess::next_key::<
while let _serde::__private::Some(__key) = __Field,
match _serde::de::MapAccess::next_key::<__Field>(&mut __map) >(&mut __map) {
{
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
} } {
{
match __key { match __key {
__Field::__field0 => { __Field::__field0 => {
if _serde::__private::Option::is_some(&__field0) { if _serde::__private::Option::is_some(&__field0) {
return _serde :: __private :: Err (< __A :: Error as _serde :: de :: Error > :: duplicate_field ("x")) ; return _serde::__private::Err(
<__A::Error as _serde::de::Error>::duplicate_field("x"),
);
} }
__field0 = _serde::__private::Some( __field0 = _serde::__private::Some(
match _serde::de::MapAccess::next_value::<T>( match _serde::de::MapAccess::next_value::<T>(&mut __map) {
&mut __map,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -507,12 +540,12 @@ const _: () = {
} }
__Field::__field1 => { __Field::__field1 => {
if _serde::__private::Option::is_some(&__field1) { if _serde::__private::Option::is_some(&__field1) {
return _serde :: __private :: Err (< __A :: Error as _serde :: de :: Error > :: duplicate_field ("y")) ; return _serde::__private::Err(
<__A::Error as _serde::de::Error>::duplicate_field("y"),
);
} }
__field1 = _serde::__private::Some( __field1 = _serde::__private::Some(
match _serde::de::MapAccess::next_value::<U>( match _serde::de::MapAccess::next_value::<U>(&mut __map) {
&mut __map,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -523,9 +556,7 @@ const _: () = {
_ => { _ => {
let _ = match _serde::de::MapAccess::next_value::< let _ = match _serde::de::MapAccess::next_value::<
_serde::de::IgnoredAny, _serde::de::IgnoredAny,
>( >(&mut __map) {
&mut __map
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
+112 -66
View File
@@ -29,7 +29,11 @@ const _: () = {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
}; };
match _serde::ser::SerializeStruct::serialize_field(&mut __serde_state, "x", &self.x) { match _serde::ser::SerializeStruct::serialize_field(
&mut __serde_state,
"x",
&self.x,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -49,7 +53,9 @@ const _: () = {
where where
T: _serde::Deserialize<'de>, T: _serde::Deserialize<'de>,
{ {
fn deserialize<__D>(__deserializer: __D) -> _serde::__private::Result<Self, __D::Error> fn deserialize<__D>(
__deserializer: __D,
) -> _serde::__private::Result<Self, __D::Error>
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
@@ -65,9 +71,15 @@ const _: () = {
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "field identifier") _serde::__private::Formatter::write_str(
__formatter,
"field identifier",
)
} }
fn visit_u64<__E>(self, __value: u64) -> _serde::__private::Result<Self::Value, __E> fn visit_u64<__E>(
self,
__value: u64,
) -> _serde::__private::Result<Self::Value, __E>
where where
__E: _serde::de::Error, __E: _serde::de::Error,
{ {
@@ -109,7 +121,10 @@ const _: () = {
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
_serde::Deserializer::deserialize_identifier(__deserializer, __FieldVisitor) _serde::Deserializer::deserialize_identifier(
__deserializer,
__FieldVisitor,
)
} }
} }
struct __Visitor<'de, T> struct __Visitor<'de, T>
@@ -128,7 +143,10 @@ const _: () = {
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "struct GenericStruct") _serde::__private::Formatter::write_str(
__formatter,
"struct GenericStruct",
)
} }
#[inline] #[inline]
fn visit_seq<__A>( fn visit_seq<__A>(
@@ -138,8 +156,9 @@ const _: () = {
where where
__A: _serde::de::SeqAccess<'de>, __A: _serde::de::SeqAccess<'de>,
{ {
let __field0 = match match _serde::de::SeqAccess::next_element::<T>(&mut __seq) let __field0 = match match _serde::de::SeqAccess::next_element::<
{ T,
>(&mut __seq) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -147,10 +166,12 @@ const _: () = {
} { } {
_serde::__private::Some(__value) => __value, _serde::__private::Some(__value) => __value,
_serde::__private::None => { _serde::__private::None => {
return _serde::__private::Err(_serde::de::Error::invalid_length( return _serde::__private::Err(
0usize, _serde::de::Error::invalid_length(
&"struct GenericStruct with 1 element", 0usize,
)); &"struct GenericStruct with 1 element",
),
);
} }
}; };
_serde::__private::Ok(GenericStruct { x: __field0 }) _serde::__private::Ok(GenericStruct { x: __field0 })
@@ -164,14 +185,13 @@ const _: () = {
__A: _serde::de::MapAccess<'de>, __A: _serde::de::MapAccess<'de>,
{ {
let mut __field0: _serde::__private::Option<T> = _serde::__private::None; let mut __field0: _serde::__private::Option<T> = _serde::__private::None;
while let _serde::__private::Some(__key) = while let _serde::__private::Some(__key)
match _serde::de::MapAccess::next_key::<__Field>(&mut __map) { = match _serde::de::MapAccess::next_key::<__Field>(&mut __map) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
} } {
{
match __key { match __key {
__Field::__field0 => { __Field::__field0 => {
if _serde::__private::Option::is_some(&__field0) { if _serde::__private::Option::is_some(&__field0) {
@@ -191,8 +211,7 @@ const _: () = {
_ => { _ => {
let _ = match _serde::de::MapAccess::next_value::< let _ = match _serde::de::MapAccess::next_value::<
_serde::de::IgnoredAny, _serde::de::IgnoredAny,
>(&mut __map) >(&mut __map) {
{
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -245,9 +264,15 @@ const _: () = {
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "field identifier") _serde::__private::Formatter::write_str(
__formatter,
"field identifier",
)
} }
fn visit_u64<__E>(self, __value: u64) -> _serde::__private::Result<Self::Value, __E> fn visit_u64<__E>(
self,
__value: u64,
) -> _serde::__private::Result<Self::Value, __E>
where where
__E: _serde::de::Error, __E: _serde::de::Error,
{ {
@@ -289,7 +314,10 @@ const _: () = {
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
_serde::Deserializer::deserialize_identifier(__deserializer, __FieldVisitor) _serde::Deserializer::deserialize_identifier(
__deserializer,
__FieldVisitor,
)
} }
} }
struct __Visitor<'de, 'place, T: 'place> struct __Visitor<'de, 'place, T: 'place>
@@ -299,7 +327,8 @@ const _: () = {
place: &'place mut GenericStruct<T>, place: &'place mut GenericStruct<T>,
lifetime: _serde::__private::PhantomData<&'de ()>, lifetime: _serde::__private::PhantomData<&'de ()>,
} }
impl<'de, 'place, T: 'place> _serde::de::Visitor<'de> for __Visitor<'de, 'place, T> impl<'de, 'place, T: 'place> _serde::de::Visitor<'de>
for __Visitor<'de, 'place, T>
where where
T: _serde::Deserialize<'de>, T: _serde::Deserialize<'de>,
{ {
@@ -308,7 +337,10 @@ const _: () = {
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "struct GenericStruct") _serde::__private::Formatter::write_str(
__formatter,
"struct GenericStruct",
)
} }
#[inline] #[inline]
fn visit_seq<__A>( fn visit_seq<__A>(
@@ -318,19 +350,22 @@ const _: () = {
where where
__A: _serde::de::SeqAccess<'de>, __A: _serde::de::SeqAccess<'de>,
{ {
if let _serde::__private::None = match _serde::de::SeqAccess::next_element_seed( if let _serde::__private::None
&mut __seq, = match _serde::de::SeqAccess::next_element_seed(
_serde::__private::de::InPlaceSeed(&mut self.place.x), &mut __seq,
) { _serde::__private::de::InPlaceSeed(&mut self.place.x),
_serde::__private::Ok(__val) => __val, ) {
_serde::__private::Err(__err) => { _serde::__private::Ok(__val) => __val,
return _serde::__private::Err(__err); _serde::__private::Err(__err) => {
} return _serde::__private::Err(__err);
} { }
return _serde::__private::Err(_serde::de::Error::invalid_length( } {
0usize, return _serde::__private::Err(
&"struct GenericStruct with 1 element", _serde::de::Error::invalid_length(
)); 0usize,
&"struct GenericStruct with 1 element",
),
);
} }
_serde::__private::Ok(()) _serde::__private::Ok(())
} }
@@ -343,14 +378,13 @@ const _: () = {
__A: _serde::de::MapAccess<'de>, __A: _serde::de::MapAccess<'de>,
{ {
let mut __field0: bool = false; let mut __field0: bool = false;
while let _serde::__private::Some(__key) = while let _serde::__private::Some(__key)
match _serde::de::MapAccess::next_key::<__Field>(&mut __map) { = match _serde::de::MapAccess::next_key::<__Field>(&mut __map) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
} } {
{
match __key { match __key {
__Field::__field0 => { __Field::__field0 => {
if __field0 { if __field0 {
@@ -372,8 +406,7 @@ const _: () = {
_ => { _ => {
let _ = match _serde::de::MapAccess::next_value::< let _ = match _serde::de::MapAccess::next_value::<
_serde::de::IgnoredAny, _serde::de::IgnoredAny,
>(&mut __map) >(&mut __map) {
{
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -383,13 +416,15 @@ const _: () = {
} }
} }
if !__field0 { if !__field0 {
self.place.x = match _serde::__private::de::missing_field("x") { self
.place
.x = match _serde::__private::de::missing_field("x") {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
}; };
}; }
_serde::__private::Ok(()) _serde::__private::Ok(())
} }
} }
@@ -442,7 +477,9 @@ const _: () = {
where where
T: _serde::Deserialize<'de>, T: _serde::Deserialize<'de>,
{ {
fn deserialize<__D>(__deserializer: __D) -> _serde::__private::Result<Self, __D::Error> fn deserialize<__D>(
__deserializer: __D,
) -> _serde::__private::Result<Self, __D::Error>
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
@@ -475,7 +512,9 @@ const _: () = {
where where
__E: _serde::Deserializer<'de>, __E: _serde::Deserializer<'de>,
{ {
let __field0: T = match <T as _serde::Deserialize>::deserialize(__e) { let __field0: T = match <T as _serde::Deserialize>::deserialize(
__e,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -491,8 +530,9 @@ const _: () = {
where where
__A: _serde::de::SeqAccess<'de>, __A: _serde::de::SeqAccess<'de>,
{ {
let __field0 = match match _serde::de::SeqAccess::next_element::<T>(&mut __seq) let __field0 = match match _serde::de::SeqAccess::next_element::<
{ T,
>(&mut __seq) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -500,10 +540,12 @@ const _: () = {
} { } {
_serde::__private::Some(__value) => __value, _serde::__private::Some(__value) => __value,
_serde::__private::None => { _serde::__private::None => {
return _serde::__private::Err(_serde::de::Error::invalid_length( return _serde::__private::Err(
0usize, _serde::de::Error::invalid_length(
&"tuple struct GenericNewTypeStruct with 1 element", 0usize,
)); &"tuple struct GenericNewTypeStruct with 1 element",
),
);
} }
}; };
_serde::__private::Ok(GenericNewTypeStruct(__field0)) _serde::__private::Ok(GenericNewTypeStruct(__field0))
@@ -532,7 +574,8 @@ const _: () = {
place: &'place mut GenericNewTypeStruct<T>, place: &'place mut GenericNewTypeStruct<T>,
lifetime: _serde::__private::PhantomData<&'de ()>, lifetime: _serde::__private::PhantomData<&'de ()>,
} }
impl<'de, 'place, T: 'place> _serde::de::Visitor<'de> for __Visitor<'de, 'place, T> impl<'de, 'place, T: 'place> _serde::de::Visitor<'de>
for __Visitor<'de, 'place, T>
where where
T: _serde::Deserialize<'de>, T: _serde::Deserialize<'de>,
{ {
@@ -564,19 +607,22 @@ const _: () = {
where where
__A: _serde::de::SeqAccess<'de>, __A: _serde::de::SeqAccess<'de>,
{ {
if let _serde::__private::None = match _serde::de::SeqAccess::next_element_seed( if let _serde::__private::None
&mut __seq, = match _serde::de::SeqAccess::next_element_seed(
_serde::__private::de::InPlaceSeed(&mut self.place.0), &mut __seq,
) { _serde::__private::de::InPlaceSeed(&mut self.place.0),
_serde::__private::Ok(__val) => __val, ) {
_serde::__private::Err(__err) => { _serde::__private::Ok(__val) => __val,
return _serde::__private::Err(__err); _serde::__private::Err(__err) => {
} return _serde::__private::Err(__err);
} { }
return _serde::__private::Err(_serde::de::Error::invalid_length( } {
0usize, return _serde::__private::Err(
&"tuple struct GenericNewTypeStruct with 1 element", _serde::de::Error::invalid_length(
)); 0usize,
&"tuple struct GenericNewTypeStruct with 1 element",
),
);
} }
_serde::__private::Ok(()) _serde::__private::Ok(())
} }
+55 -40
View File
@@ -11,7 +11,9 @@ const _: () = {
T: _serde::Deserialize<'de>, T: _serde::Deserialize<'de>,
U: _serde::Deserialize<'de>, U: _serde::Deserialize<'de>,
{ {
fn deserialize<__D>(__deserializer: __D) -> _serde::__private::Result<Self, __D::Error> fn deserialize<__D>(
__deserializer: __D,
) -> _serde::__private::Result<Self, __D::Error>
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
@@ -46,8 +48,9 @@ const _: () = {
where where
__A: _serde::de::SeqAccess<'de>, __A: _serde::de::SeqAccess<'de>,
{ {
let __field0 = match match _serde::de::SeqAccess::next_element::<T>(&mut __seq) let __field0 = match match _serde::de::SeqAccess::next_element::<
{ T,
>(&mut __seq) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -55,14 +58,17 @@ const _: () = {
} { } {
_serde::__private::Some(__value) => __value, _serde::__private::Some(__value) => __value,
_serde::__private::None => { _serde::__private::None => {
return _serde::__private::Err(_serde::de::Error::invalid_length( return _serde::__private::Err(
0usize, _serde::de::Error::invalid_length(
&"tuple struct GenericTupleStruct with 2 elements", 0usize,
)); &"tuple struct GenericTupleStruct with 2 elements",
),
);
} }
}; };
let __field1 = match match _serde::de::SeqAccess::next_element::<U>(&mut __seq) let __field1 = match match _serde::de::SeqAccess::next_element::<
{ U,
>(&mut __seq) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -70,10 +76,12 @@ const _: () = {
} { } {
_serde::__private::Some(__value) => __value, _serde::__private::Some(__value) => __value,
_serde::__private::None => { _serde::__private::None => {
return _serde::__private::Err(_serde::de::Error::invalid_length( return _serde::__private::Err(
1usize, _serde::de::Error::invalid_length(
&"tuple struct GenericTupleStruct with 2 elements", 1usize,
)); &"tuple struct GenericTupleStruct with 2 elements",
),
);
} }
}; };
_serde::__private::Ok(GenericTupleStruct(__field0, __field1)) _serde::__private::Ok(GenericTupleStruct(__field0, __field1))
@@ -104,7 +112,8 @@ const _: () = {
place: &'place mut GenericTupleStruct<T, U>, place: &'place mut GenericTupleStruct<T, U>,
lifetime: _serde::__private::PhantomData<&'de ()>, lifetime: _serde::__private::PhantomData<&'de ()>,
} }
impl<'de, 'place, T: 'place, U: 'place> _serde::de::Visitor<'de> for __Visitor<'de, 'place, T, U> impl<'de, 'place, T: 'place, U: 'place> _serde::de::Visitor<'de>
for __Visitor<'de, 'place, T, U>
where where
T: _serde::Deserialize<'de>, T: _serde::Deserialize<'de>,
U: _serde::Deserialize<'de>, U: _serde::Deserialize<'de>,
@@ -127,33 +136,39 @@ const _: () = {
where where
__A: _serde::de::SeqAccess<'de>, __A: _serde::de::SeqAccess<'de>,
{ {
if let _serde::__private::None = match _serde::de::SeqAccess::next_element_seed( if let _serde::__private::None
&mut __seq, = match _serde::de::SeqAccess::next_element_seed(
_serde::__private::de::InPlaceSeed(&mut self.place.0), &mut __seq,
) { _serde::__private::de::InPlaceSeed(&mut self.place.0),
_serde::__private::Ok(__val) => __val, ) {
_serde::__private::Err(__err) => { _serde::__private::Ok(__val) => __val,
return _serde::__private::Err(__err); _serde::__private::Err(__err) => {
} return _serde::__private::Err(__err);
} { }
return _serde::__private::Err(_serde::de::Error::invalid_length( } {
0usize, return _serde::__private::Err(
&"tuple struct GenericTupleStruct with 2 elements", _serde::de::Error::invalid_length(
)); 0usize,
&"tuple struct GenericTupleStruct with 2 elements",
),
);
} }
if let _serde::__private::None = match _serde::de::SeqAccess::next_element_seed( if let _serde::__private::None
&mut __seq, = match _serde::de::SeqAccess::next_element_seed(
_serde::__private::de::InPlaceSeed(&mut self.place.1), &mut __seq,
) { _serde::__private::de::InPlaceSeed(&mut self.place.1),
_serde::__private::Ok(__val) => __val, ) {
_serde::__private::Err(__err) => { _serde::__private::Ok(__val) => __val,
return _serde::__private::Err(__err); _serde::__private::Err(__err) => {
} return _serde::__private::Err(__err);
} { }
return _serde::__private::Err(_serde::de::Error::invalid_length( } {
1usize, return _serde::__private::Err(
&"tuple struct GenericTupleStruct with 2 elements", _serde::de::Error::invalid_length(
)); 1usize,
&"tuple struct GenericTupleStruct with 2 elements",
),
);
} }
_serde::__private::Ok(()) _serde::__private::Ok(())
} }
+109 -73
View File
@@ -99,7 +99,9 @@ const _: () = {
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> {
fn deserialize<__D>(__deserializer: __D) -> _serde::__private::Result<Self, __D::Error> fn deserialize<__D>(
__deserializer: __D,
) -> _serde::__private::Result<Self, __D::Error>
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
@@ -117,9 +119,15 @@ const _: () = {
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "variant identifier") _serde::__private::Formatter::write_str(
__formatter,
"variant identifier",
)
} }
fn visit_u64<__E>(self, __value: u64) -> _serde::__private::Result<Self::Value, __E> fn visit_u64<__E>(
self,
__value: u64,
) -> _serde::__private::Result<Self::Value, __E>
where where
__E: _serde::de::Error, __E: _serde::de::Error,
{ {
@@ -128,10 +136,14 @@ const _: () = {
1u64 => _serde::__private::Ok(__Field::__field1), 1u64 => _serde::__private::Ok(__Field::__field1),
2u64 => _serde::__private::Ok(__Field::__field2), 2u64 => _serde::__private::Ok(__Field::__field2),
3u64 => _serde::__private::Ok(__Field::__field3), 3u64 => _serde::__private::Ok(__Field::__field3),
_ => _serde::__private::Err(_serde::de::Error::invalid_value( _ => {
_serde::de::Unexpected::Unsigned(__value), _serde::__private::Err(
&"variant index 0 <= i < 4", _serde::de::Error::invalid_value(
)), _serde::de::Unexpected::Unsigned(__value),
&"variant index 0 <= i < 4",
),
)
}
} }
} }
fn visit_str<__E>( fn visit_str<__E>(
@@ -146,9 +158,11 @@ const _: () = {
"NoLifetimeSeq" => _serde::__private::Ok(__Field::__field1), "NoLifetimeSeq" => _serde::__private::Ok(__Field::__field1),
"LifetimeMap" => _serde::__private::Ok(__Field::__field2), "LifetimeMap" => _serde::__private::Ok(__Field::__field2),
"NoLifetimeMap" => _serde::__private::Ok(__Field::__field3), "NoLifetimeMap" => _serde::__private::Ok(__Field::__field3),
_ => _serde::__private::Err(_serde::de::Error::unknown_variant( _ => {
__value, VARIANTS, _serde::__private::Err(
)), _serde::de::Error::unknown_variant(__value, VARIANTS),
)
}
} }
} }
fn visit_bytes<__E>( fn visit_bytes<__E>(
@@ -165,9 +179,9 @@ const _: () = {
b"NoLifetimeMap" => _serde::__private::Ok(__Field::__field3), b"NoLifetimeMap" => _serde::__private::Ok(__Field::__field3),
_ => { _ => {
let __value = &_serde::__private::from_utf8_lossy(__value); let __value = &_serde::__private::from_utf8_lossy(__value);
_serde::__private::Err(_serde::de::Error::unknown_variant( _serde::__private::Err(
__value, VARIANTS, _serde::de::Error::unknown_variant(__value, VARIANTS),
)) )
} }
} }
} }
@@ -180,7 +194,10 @@ const _: () = {
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
_serde::Deserializer::deserialize_identifier(__deserializer, __FieldVisitor) _serde::Deserializer::deserialize_identifier(
__deserializer,
__FieldVisitor,
)
} }
} }
struct __Visitor<'de, 'a> { struct __Visitor<'de, 'a> {
@@ -193,7 +210,10 @@ const _: () = {
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "enum Lifetimes") _serde::__private::Formatter::write_str(
__formatter,
"enum Lifetimes",
)
} }
fn visit_enum<__A>( fn visit_enum<__A>(
self, self,
@@ -208,14 +228,22 @@ const _: () = {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
} { } {
(__Field::__field0, __variant) => _serde::__private::Result::map( (__Field::__field0, __variant) => {
_serde::de::VariantAccess::newtype_variant::<&'a i32>(__variant), _serde::__private::Result::map(
Lifetimes::LifetimeSeq, _serde::de::VariantAccess::newtype_variant::<
), &'a i32,
(__Field::__field1, __variant) => _serde::__private::Result::map( >(__variant),
_serde::de::VariantAccess::newtype_variant::<i32>(__variant), Lifetimes::LifetimeSeq,
Lifetimes::NoLifetimeSeq, )
), }
(__Field::__field1, __variant) => {
_serde::__private::Result::map(
_serde::de::VariantAccess::newtype_variant::<
i32,
>(__variant),
Lifetimes::NoLifetimeSeq,
)
}
(__Field::__field2, __variant) => { (__Field::__field2, __variant) => {
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
enum __Field { enum __Field {
@@ -228,8 +256,7 @@ const _: () = {
fn expecting( fn expecting(
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result ) -> _serde::__private::fmt::Result {
{
_serde::__private::Formatter::write_str( _serde::__private::Formatter::write_str(
__formatter, __formatter,
"field identifier", "field identifier",
@@ -290,13 +317,13 @@ const _: () = {
marker: _serde::__private::PhantomData<Lifetimes<'a>>, marker: _serde::__private::PhantomData<Lifetimes<'a>>,
lifetime: _serde::__private::PhantomData<&'de ()>, lifetime: _serde::__private::PhantomData<&'de ()>,
} }
impl<'de, 'a> _serde::de::Visitor<'de> for __Visitor<'de, 'a> { impl<'de, 'a> _serde::de::Visitor<'de>
for __Visitor<'de, 'a> {
type Value = Lifetimes<'a>; type Value = Lifetimes<'a>;
fn expecting( fn expecting(
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result ) -> _serde::__private::fmt::Result {
{
_serde::__private::Formatter::write_str( _serde::__private::Formatter::write_str(
__formatter, __formatter,
"struct variant Lifetimes::LifetimeMap", "struct variant Lifetimes::LifetimeMap",
@@ -312,9 +339,7 @@ const _: () = {
{ {
let __field0 = match match _serde::de::SeqAccess::next_element::< let __field0 = match match _serde::de::SeqAccess::next_element::<
&'a i32, &'a i32,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -322,10 +347,17 @@ const _: () = {
} { } {
_serde::__private::Some(__value) => __value, _serde::__private::Some(__value) => __value,
_serde::__private::None => { _serde::__private::None => {
return _serde :: __private :: Err (_serde :: de :: Error :: invalid_length (0usize , & "struct variant Lifetimes::LifetimeMap with 1 element")) ; return _serde::__private::Err(
_serde::de::Error::invalid_length(
0usize,
&"struct variant Lifetimes::LifetimeMap with 1 element",
),
);
} }
}; };
_serde::__private::Ok(Lifetimes::LifetimeMap { a: __field0 }) _serde::__private::Ok(Lifetimes::LifetimeMap {
a: __field0,
})
} }
#[inline] #[inline]
fn visit_map<__A>( fn visit_map<__A>(
@@ -335,26 +367,27 @@ const _: () = {
where where
__A: _serde::de::MapAccess<'de>, __A: _serde::de::MapAccess<'de>,
{ {
let mut __field0: _serde::__private::Option<&'a i32> = let mut __field0: _serde::__private::Option<&'a i32> = _serde::__private::None;
_serde::__private::None; while let _serde::__private::Some(__key)
while let _serde::__private::Some(__key) = = match _serde::de::MapAccess::next_key::<
match _serde::de::MapAccess::next_key::<__Field>(&mut __map) __Field,
{ >(&mut __map) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
} } {
{
match __key { match __key {
__Field::__field0 => { __Field::__field0 => {
if _serde::__private::Option::is_some(&__field0) { if _serde::__private::Option::is_some(&__field0) {
return _serde :: __private :: Err (< __A :: Error as _serde :: de :: Error > :: duplicate_field ("a")) ; return _serde::__private::Err(
<__A::Error as _serde::de::Error>::duplicate_field("a"),
);
} }
__field0 = _serde::__private::Some( __field0 = _serde::__private::Some(
match _serde::de::MapAccess::next_value::<&'a i32>( match _serde::de::MapAccess::next_value::<
&mut __map, &'a i32,
) { >(&mut __map) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -365,9 +398,7 @@ const _: () = {
_ => { _ => {
let _ = match _serde::de::MapAccess::next_value::< let _ = match _serde::de::MapAccess::next_value::<
_serde::de::IgnoredAny, _serde::de::IgnoredAny,
>( >(&mut __map) {
&mut __map
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -387,7 +418,9 @@ const _: () = {
} }
} }
}; };
_serde::__private::Ok(Lifetimes::LifetimeMap { a: __field0 }) _serde::__private::Ok(Lifetimes::LifetimeMap {
a: __field0,
})
} }
} }
const FIELDS: &'static [&'static str] = &["a"]; const FIELDS: &'static [&'static str] = &["a"];
@@ -412,8 +445,7 @@ const _: () = {
fn expecting( fn expecting(
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result ) -> _serde::__private::fmt::Result {
{
_serde::__private::Formatter::write_str( _serde::__private::Formatter::write_str(
__formatter, __formatter,
"field identifier", "field identifier",
@@ -474,13 +506,13 @@ const _: () = {
marker: _serde::__private::PhantomData<Lifetimes<'a>>, marker: _serde::__private::PhantomData<Lifetimes<'a>>,
lifetime: _serde::__private::PhantomData<&'de ()>, lifetime: _serde::__private::PhantomData<&'de ()>,
} }
impl<'de, 'a> _serde::de::Visitor<'de> for __Visitor<'de, 'a> { impl<'de, 'a> _serde::de::Visitor<'de>
for __Visitor<'de, 'a> {
type Value = Lifetimes<'a>; type Value = Lifetimes<'a>;
fn expecting( fn expecting(
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result ) -> _serde::__private::fmt::Result {
{
_serde::__private::Formatter::write_str( _serde::__private::Formatter::write_str(
__formatter, __formatter,
"struct variant Lifetimes::NoLifetimeMap", "struct variant Lifetimes::NoLifetimeMap",
@@ -496,9 +528,7 @@ const _: () = {
{ {
let __field0 = match match _serde::de::SeqAccess::next_element::< let __field0 = match match _serde::de::SeqAccess::next_element::<
i32, i32,
>( >(&mut __seq) {
&mut __seq
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -506,10 +536,17 @@ const _: () = {
} { } {
_serde::__private::Some(__value) => __value, _serde::__private::Some(__value) => __value,
_serde::__private::None => { _serde::__private::None => {
return _serde :: __private :: Err (_serde :: de :: Error :: invalid_length (0usize , & "struct variant Lifetimes::NoLifetimeMap with 1 element")) ; return _serde::__private::Err(
_serde::de::Error::invalid_length(
0usize,
&"struct variant Lifetimes::NoLifetimeMap with 1 element",
),
);
} }
}; };
_serde::__private::Ok(Lifetimes::NoLifetimeMap { a: __field0 }) _serde::__private::Ok(Lifetimes::NoLifetimeMap {
a: __field0,
})
} }
#[inline] #[inline]
fn visit_map<__A>( fn visit_map<__A>(
@@ -519,26 +556,25 @@ const _: () = {
where where
__A: _serde::de::MapAccess<'de>, __A: _serde::de::MapAccess<'de>,
{ {
let mut __field0: _serde::__private::Option<i32> = let mut __field0: _serde::__private::Option<i32> = _serde::__private::None;
_serde::__private::None; while let _serde::__private::Some(__key)
while let _serde::__private::Some(__key) = = match _serde::de::MapAccess::next_key::<
match _serde::de::MapAccess::next_key::<__Field>(&mut __map) __Field,
{ >(&mut __map) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
} } {
{
match __key { match __key {
__Field::__field0 => { __Field::__field0 => {
if _serde::__private::Option::is_some(&__field0) { if _serde::__private::Option::is_some(&__field0) {
return _serde :: __private :: Err (< __A :: Error as _serde :: de :: Error > :: duplicate_field ("a")) ; return _serde::__private::Err(
<__A::Error as _serde::de::Error>::duplicate_field("a"),
);
} }
__field0 = _serde::__private::Some( __field0 = _serde::__private::Some(
match _serde::de::MapAccess::next_value::<i32>( match _serde::de::MapAccess::next_value::<i32>(&mut __map) {
&mut __map,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -549,9 +585,7 @@ const _: () = {
_ => { _ => {
let _ = match _serde::de::MapAccess::next_value::< let _ = match _serde::de::MapAccess::next_value::<
_serde::de::IgnoredAny, _serde::de::IgnoredAny,
>( >(&mut __map) {
&mut __map
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -571,7 +605,9 @@ const _: () = {
} }
} }
}; };
_serde::__private::Ok(Lifetimes::NoLifetimeMap { a: __field0 }) _serde::__private::Ok(Lifetimes::NoLifetimeMap {
a: __field0,
})
} }
} }
const FIELDS: &'static [&'static str] = &["a"]; const FIELDS: &'static [&'static str] = &["a"];
+146 -88
View File
@@ -33,19 +33,31 @@ const _: () = {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
}; };
match _serde::ser::SerializeStruct::serialize_field(&mut __serde_state, "a", &self.a) { match _serde::ser::SerializeStruct::serialize_field(
&mut __serde_state,
"a",
&self.a,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
}; };
match _serde::ser::SerializeStruct::serialize_field(&mut __serde_state, "b", &self.b) { match _serde::ser::SerializeStruct::serialize_field(
&mut __serde_state,
"b",
&self.b,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
}; };
match _serde::ser::SerializeStruct::serialize_field(&mut __serde_state, "c", &self.c) { match _serde::ser::SerializeStruct::serialize_field(
&mut __serde_state,
"c",
&self.c,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -72,7 +84,9 @@ const _: () = {
B: _serde::Deserialize<'de>, B: _serde::Deserialize<'de>,
C: _serde::Deserialize<'de>, C: _serde::Deserialize<'de>,
{ {
fn deserialize<__D>(__deserializer: __D) -> _serde::__private::Result<Self, __D::Error> fn deserialize<__D>(
__deserializer: __D,
) -> _serde::__private::Result<Self, __D::Error>
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
@@ -90,9 +104,15 @@ const _: () = {
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "field identifier") _serde::__private::Formatter::write_str(
__formatter,
"field identifier",
)
} }
fn visit_u64<__E>(self, __value: u64) -> _serde::__private::Result<Self::Value, __E> fn visit_u64<__E>(
self,
__value: u64,
) -> _serde::__private::Result<Self::Value, __E>
where where
__E: _serde::de::Error, __E: _serde::de::Error,
{ {
@@ -140,7 +160,10 @@ const _: () = {
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
_serde::Deserializer::deserialize_identifier(__deserializer, __FieldVisitor) _serde::Deserializer::deserialize_identifier(
__deserializer,
__FieldVisitor,
)
} }
} }
struct __Visitor<'de, A, B, C> struct __Visitor<'de, A, B, C>
@@ -163,7 +186,10 @@ const _: () = {
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "struct DeNamedMap") _serde::__private::Formatter::write_str(
__formatter,
"struct DeNamedMap",
)
} }
#[inline] #[inline]
fn visit_seq<__A>( fn visit_seq<__A>(
@@ -173,8 +199,9 @@ const _: () = {
where where
__A: _serde::de::SeqAccess<'de>, __A: _serde::de::SeqAccess<'de>,
{ {
let __field0 = match match _serde::de::SeqAccess::next_element::<A>(&mut __seq) let __field0 = match match _serde::de::SeqAccess::next_element::<
{ A,
>(&mut __seq) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -182,14 +209,17 @@ const _: () = {
} { } {
_serde::__private::Some(__value) => __value, _serde::__private::Some(__value) => __value,
_serde::__private::None => { _serde::__private::None => {
return _serde::__private::Err(_serde::de::Error::invalid_length( return _serde::__private::Err(
0usize, _serde::de::Error::invalid_length(
&"struct DeNamedMap with 3 elements", 0usize,
)); &"struct DeNamedMap with 3 elements",
),
);
} }
}; };
let __field1 = match match _serde::de::SeqAccess::next_element::<B>(&mut __seq) let __field1 = match match _serde::de::SeqAccess::next_element::<
{ B,
>(&mut __seq) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -197,14 +227,17 @@ const _: () = {
} { } {
_serde::__private::Some(__value) => __value, _serde::__private::Some(__value) => __value,
_serde::__private::None => { _serde::__private::None => {
return _serde::__private::Err(_serde::de::Error::invalid_length( return _serde::__private::Err(
1usize, _serde::de::Error::invalid_length(
&"struct DeNamedMap with 3 elements", 1usize,
)); &"struct DeNamedMap with 3 elements",
),
);
} }
}; };
let __field2 = match match _serde::de::SeqAccess::next_element::<C>(&mut __seq) let __field2 = match match _serde::de::SeqAccess::next_element::<
{ C,
>(&mut __seq) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -212,10 +245,12 @@ const _: () = {
} { } {
_serde::__private::Some(__value) => __value, _serde::__private::Some(__value) => __value,
_serde::__private::None => { _serde::__private::None => {
return _serde::__private::Err(_serde::de::Error::invalid_length( return _serde::__private::Err(
2usize, _serde::de::Error::invalid_length(
&"struct DeNamedMap with 3 elements", 2usize,
)); &"struct DeNamedMap with 3 elements",
),
);
} }
}; };
_serde::__private::Ok(DeNamedMap { _serde::__private::Ok(DeNamedMap {
@@ -235,14 +270,13 @@ const _: () = {
let mut __field0: _serde::__private::Option<A> = _serde::__private::None; let mut __field0: _serde::__private::Option<A> = _serde::__private::None;
let mut __field1: _serde::__private::Option<B> = _serde::__private::None; let mut __field1: _serde::__private::Option<B> = _serde::__private::None;
let mut __field2: _serde::__private::Option<C> = _serde::__private::None; let mut __field2: _serde::__private::Option<C> = _serde::__private::None;
while let _serde::__private::Some(__key) = while let _serde::__private::Some(__key)
match _serde::de::MapAccess::next_key::<__Field>(&mut __map) { = match _serde::de::MapAccess::next_key::<__Field>(&mut __map) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
} } {
{
match __key { match __key {
__Field::__field0 => { __Field::__field0 => {
if _serde::__private::Option::is_some(&__field0) { if _serde::__private::Option::is_some(&__field0) {
@@ -292,8 +326,7 @@ const _: () = {
_ => { _ => {
let _ = match _serde::de::MapAccess::next_value::< let _ = match _serde::de::MapAccess::next_value::<
_serde::de::IgnoredAny, _serde::de::IgnoredAny,
>(&mut __map) >(&mut __map) {
{
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -374,9 +407,15 @@ const _: () = {
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "field identifier") _serde::__private::Formatter::write_str(
__formatter,
"field identifier",
)
} }
fn visit_u64<__E>(self, __value: u64) -> _serde::__private::Result<Self::Value, __E> fn visit_u64<__E>(
self,
__value: u64,
) -> _serde::__private::Result<Self::Value, __E>
where where
__E: _serde::de::Error, __E: _serde::de::Error,
{ {
@@ -424,7 +463,10 @@ const _: () = {
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
_serde::Deserializer::deserialize_identifier(__deserializer, __FieldVisitor) _serde::Deserializer::deserialize_identifier(
__deserializer,
__FieldVisitor,
)
} }
} }
struct __Visitor<'de, 'place, A: 'place, B: 'place, C: 'place> struct __Visitor<'de, 'place, A: 'place, B: 'place, C: 'place>
@@ -437,7 +479,7 @@ const _: () = {
lifetime: _serde::__private::PhantomData<&'de ()>, lifetime: _serde::__private::PhantomData<&'de ()>,
} }
impl<'de, 'place, A: 'place, B: 'place, C: 'place> _serde::de::Visitor<'de> impl<'de, 'place, A: 'place, B: 'place, C: 'place> _serde::de::Visitor<'de>
for __Visitor<'de, 'place, A, B, C> for __Visitor<'de, 'place, A, B, C>
where where
A: _serde::Deserialize<'de>, A: _serde::Deserialize<'de>,
B: _serde::Deserialize<'de>, B: _serde::Deserialize<'de>,
@@ -448,7 +490,10 @@ const _: () = {
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "struct DeNamedMap") _serde::__private::Formatter::write_str(
__formatter,
"struct DeNamedMap",
)
} }
#[inline] #[inline]
fn visit_seq<__A>( fn visit_seq<__A>(
@@ -458,47 +503,56 @@ const _: () = {
where where
__A: _serde::de::SeqAccess<'de>, __A: _serde::de::SeqAccess<'de>,
{ {
if let _serde::__private::None = match _serde::de::SeqAccess::next_element_seed( if let _serde::__private::None
&mut __seq, = match _serde::de::SeqAccess::next_element_seed(
_serde::__private::de::InPlaceSeed(&mut self.place.a), &mut __seq,
) { _serde::__private::de::InPlaceSeed(&mut self.place.a),
_serde::__private::Ok(__val) => __val, ) {
_serde::__private::Err(__err) => { _serde::__private::Ok(__val) => __val,
return _serde::__private::Err(__err); _serde::__private::Err(__err) => {
} return _serde::__private::Err(__err);
} { }
return _serde::__private::Err(_serde::de::Error::invalid_length( } {
0usize, return _serde::__private::Err(
&"struct DeNamedMap with 3 elements", _serde::de::Error::invalid_length(
)); 0usize,
&"struct DeNamedMap with 3 elements",
),
);
} }
if let _serde::__private::None = match _serde::de::SeqAccess::next_element_seed( if let _serde::__private::None
&mut __seq, = match _serde::de::SeqAccess::next_element_seed(
_serde::__private::de::InPlaceSeed(&mut self.place.b), &mut __seq,
) { _serde::__private::de::InPlaceSeed(&mut self.place.b),
_serde::__private::Ok(__val) => __val, ) {
_serde::__private::Err(__err) => { _serde::__private::Ok(__val) => __val,
return _serde::__private::Err(__err); _serde::__private::Err(__err) => {
} return _serde::__private::Err(__err);
} { }
return _serde::__private::Err(_serde::de::Error::invalid_length( } {
1usize, return _serde::__private::Err(
&"struct DeNamedMap with 3 elements", _serde::de::Error::invalid_length(
)); 1usize,
&"struct DeNamedMap with 3 elements",
),
);
} }
if let _serde::__private::None = match _serde::de::SeqAccess::next_element_seed( if let _serde::__private::None
&mut __seq, = match _serde::de::SeqAccess::next_element_seed(
_serde::__private::de::InPlaceSeed(&mut self.place.c), &mut __seq,
) { _serde::__private::de::InPlaceSeed(&mut self.place.c),
_serde::__private::Ok(__val) => __val, ) {
_serde::__private::Err(__err) => { _serde::__private::Ok(__val) => __val,
return _serde::__private::Err(__err); _serde::__private::Err(__err) => {
} return _serde::__private::Err(__err);
} { }
return _serde::__private::Err(_serde::de::Error::invalid_length( } {
2usize, return _serde::__private::Err(
&"struct DeNamedMap with 3 elements", _serde::de::Error::invalid_length(
)); 2usize,
&"struct DeNamedMap with 3 elements",
),
);
} }
_serde::__private::Ok(()) _serde::__private::Ok(())
} }
@@ -513,14 +567,13 @@ const _: () = {
let mut __field0: bool = false; let mut __field0: bool = false;
let mut __field1: bool = false; let mut __field1: bool = false;
let mut __field2: bool = false; let mut __field2: bool = false;
while let _serde::__private::Some(__key) = while let _serde::__private::Some(__key)
match _serde::de::MapAccess::next_key::<__Field>(&mut __map) { = match _serde::de::MapAccess::next_key::<__Field>(&mut __map) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
} } {
{
match __key { match __key {
__Field::__field0 => { __Field::__field0 => {
if __field0 { if __field0 {
@@ -576,8 +629,7 @@ const _: () = {
_ => { _ => {
let _ = match _serde::de::MapAccess::next_value::< let _ = match _serde::de::MapAccess::next_value::<
_serde::de::IgnoredAny, _serde::de::IgnoredAny,
>(&mut __map) >(&mut __map) {
{
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -587,29 +639,35 @@ const _: () = {
} }
} }
if !__field0 { if !__field0 {
self.place.a = match _serde::__private::de::missing_field("a") { self
.place
.a = match _serde::__private::de::missing_field("a") {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
}; };
}; }
if !__field1 { if !__field1 {
self.place.b = match _serde::__private::de::missing_field("b") { self
.place
.b = match _serde::__private::de::missing_field("b") {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
}; };
}; }
if !__field2 { if !__field2 {
self.place.c = match _serde::__private::de::missing_field("c") { self
.place
.c = match _serde::__private::de::missing_field("c") {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
}; };
}; }
_serde::__private::Ok(()) _serde::__private::Ok(())
} }
} }
+91 -62
View File
@@ -29,19 +29,28 @@ const _: () = {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
}; };
match _serde::ser::SerializeTupleStruct::serialize_field(&mut __serde_state, &self.0) { match _serde::ser::SerializeTupleStruct::serialize_field(
&mut __serde_state,
&self.0,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
}; };
match _serde::ser::SerializeTupleStruct::serialize_field(&mut __serde_state, &self.1) { match _serde::ser::SerializeTupleStruct::serialize_field(
&mut __serde_state,
&self.1,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
} }
}; };
match _serde::ser::SerializeTupleStruct::serialize_field(&mut __serde_state, &self.2) { match _serde::ser::SerializeTupleStruct::serialize_field(
&mut __serde_state,
&self.2,
) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -64,7 +73,9 @@ const _: () = {
B: _serde::Deserialize<'de>, B: _serde::Deserialize<'de>,
C: _serde::Deserialize<'de>, C: _serde::Deserialize<'de>,
{ {
fn deserialize<__D>(__deserializer: __D) -> _serde::__private::Result<Self, __D::Error> fn deserialize<__D>(
__deserializer: __D,
) -> _serde::__private::Result<Self, __D::Error>
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
@@ -101,8 +112,9 @@ const _: () = {
where where
__A: _serde::de::SeqAccess<'de>, __A: _serde::de::SeqAccess<'de>,
{ {
let __field0 = match match _serde::de::SeqAccess::next_element::<A>(&mut __seq) let __field0 = match match _serde::de::SeqAccess::next_element::<
{ A,
>(&mut __seq) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -110,14 +122,17 @@ const _: () = {
} { } {
_serde::__private::Some(__value) => __value, _serde::__private::Some(__value) => __value,
_serde::__private::None => { _serde::__private::None => {
return _serde::__private::Err(_serde::de::Error::invalid_length( return _serde::__private::Err(
0usize, _serde::de::Error::invalid_length(
&"tuple struct DeNamedTuple with 3 elements", 0usize,
)); &"tuple struct DeNamedTuple with 3 elements",
),
);
} }
}; };
let __field1 = match match _serde::de::SeqAccess::next_element::<B>(&mut __seq) let __field1 = match match _serde::de::SeqAccess::next_element::<
{ B,
>(&mut __seq) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -125,14 +140,17 @@ const _: () = {
} { } {
_serde::__private::Some(__value) => __value, _serde::__private::Some(__value) => __value,
_serde::__private::None => { _serde::__private::None => {
return _serde::__private::Err(_serde::de::Error::invalid_length( return _serde::__private::Err(
1usize, _serde::de::Error::invalid_length(
&"tuple struct DeNamedTuple with 3 elements", 1usize,
)); &"tuple struct DeNamedTuple with 3 elements",
),
);
} }
}; };
let __field2 = match match _serde::de::SeqAccess::next_element::<C>(&mut __seq) let __field2 = match match _serde::de::SeqAccess::next_element::<
{ C,
>(&mut __seq) {
_serde::__private::Ok(__val) => __val, _serde::__private::Ok(__val) => __val,
_serde::__private::Err(__err) => { _serde::__private::Err(__err) => {
return _serde::__private::Err(__err); return _serde::__private::Err(__err);
@@ -140,10 +158,12 @@ const _: () = {
} { } {
_serde::__private::Some(__value) => __value, _serde::__private::Some(__value) => __value,
_serde::__private::None => { _serde::__private::None => {
return _serde::__private::Err(_serde::de::Error::invalid_length( return _serde::__private::Err(
2usize, _serde::de::Error::invalid_length(
&"tuple struct DeNamedTuple with 3 elements", 2usize,
)); &"tuple struct DeNamedTuple with 3 elements",
),
);
} }
}; };
_serde::__private::Ok(DeNamedTuple(__field0, __field1, __field2)) _serde::__private::Ok(DeNamedTuple(__field0, __field1, __field2))
@@ -176,7 +196,7 @@ const _: () = {
lifetime: _serde::__private::PhantomData<&'de ()>, lifetime: _serde::__private::PhantomData<&'de ()>,
} }
impl<'de, 'place, A: 'place, B: 'place, C: 'place> _serde::de::Visitor<'de> impl<'de, 'place, A: 'place, B: 'place, C: 'place> _serde::de::Visitor<'de>
for __Visitor<'de, 'place, A, B, C> for __Visitor<'de, 'place, A, B, C>
where where
A: _serde::Deserialize<'de>, A: _serde::Deserialize<'de>,
B: _serde::Deserialize<'de>, B: _serde::Deserialize<'de>,
@@ -200,47 +220,56 @@ const _: () = {
where where
__A: _serde::de::SeqAccess<'de>, __A: _serde::de::SeqAccess<'de>,
{ {
if let _serde::__private::None = match _serde::de::SeqAccess::next_element_seed( if let _serde::__private::None
&mut __seq, = match _serde::de::SeqAccess::next_element_seed(
_serde::__private::de::InPlaceSeed(&mut self.place.0), &mut __seq,
) { _serde::__private::de::InPlaceSeed(&mut self.place.0),
_serde::__private::Ok(__val) => __val, ) {
_serde::__private::Err(__err) => { _serde::__private::Ok(__val) => __val,
return _serde::__private::Err(__err); _serde::__private::Err(__err) => {
} return _serde::__private::Err(__err);
} { }
return _serde::__private::Err(_serde::de::Error::invalid_length( } {
0usize, return _serde::__private::Err(
&"tuple struct DeNamedTuple with 3 elements", _serde::de::Error::invalid_length(
)); 0usize,
&"tuple struct DeNamedTuple with 3 elements",
),
);
} }
if let _serde::__private::None = match _serde::de::SeqAccess::next_element_seed( if let _serde::__private::None
&mut __seq, = match _serde::de::SeqAccess::next_element_seed(
_serde::__private::de::InPlaceSeed(&mut self.place.1), &mut __seq,
) { _serde::__private::de::InPlaceSeed(&mut self.place.1),
_serde::__private::Ok(__val) => __val, ) {
_serde::__private::Err(__err) => { _serde::__private::Ok(__val) => __val,
return _serde::__private::Err(__err); _serde::__private::Err(__err) => {
} return _serde::__private::Err(__err);
} { }
return _serde::__private::Err(_serde::de::Error::invalid_length( } {
1usize, return _serde::__private::Err(
&"tuple struct DeNamedTuple with 3 elements", _serde::de::Error::invalid_length(
)); 1usize,
&"tuple struct DeNamedTuple with 3 elements",
),
);
} }
if let _serde::__private::None = match _serde::de::SeqAccess::next_element_seed( if let _serde::__private::None
&mut __seq, = match _serde::de::SeqAccess::next_element_seed(
_serde::__private::de::InPlaceSeed(&mut self.place.2), &mut __seq,
) { _serde::__private::de::InPlaceSeed(&mut self.place.2),
_serde::__private::Ok(__val) => __val, ) {
_serde::__private::Err(__err) => { _serde::__private::Ok(__val) => __val,
return _serde::__private::Err(__err); _serde::__private::Err(__err) => {
} return _serde::__private::Err(__err);
} { }
return _serde::__private::Err(_serde::de::Error::invalid_length( } {
2usize, return _serde::__private::Err(
&"tuple struct DeNamedTuple with 3 elements", _serde::de::Error::invalid_length(
)); 2usize,
&"tuple struct DeNamedTuple with 3 elements",
),
);
} }
_serde::__private::Ok(()) _serde::__private::Ok(())
} }
+12 -3
View File
@@ -25,7 +25,9 @@ const _: () = {
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 {
fn deserialize<__D>(__deserializer: __D) -> _serde::__private::Result<Self, __D::Error> fn deserialize<__D>(
__deserializer: __D,
) -> _serde::__private::Result<Self, __D::Error>
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
@@ -36,7 +38,10 @@ const _: () = {
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "unit struct NamedUnit") _serde::__private::Formatter::write_str(
__formatter,
"unit struct NamedUnit",
)
} }
#[inline] #[inline]
fn visit_unit<__E>(self) -> _serde::__private::Result<Self::Value, __E> fn visit_unit<__E>(self) -> _serde::__private::Result<Self::Value, __E>
@@ -46,7 +51,11 @@ const _: () = {
_serde::__private::Ok(NamedUnit) _serde::__private::Ok(NamedUnit)
} }
} }
_serde::Deserializer::deserialize_unit_struct(__deserializer, "NamedUnit", __Visitor) _serde::Deserializer::deserialize_unit_struct(
__deserializer,
"NamedUnit",
__Visitor,
)
} }
} }
}; };
+24 -25
View File
@@ -31,12 +31,14 @@ const _: () = {
__S: _serde::Serializer, __S: _serde::Serializer,
{ {
match *self { match *self {
SerEnum::Unit => _serde::Serializer::serialize_unit_variant( SerEnum::Unit => {
__serializer, _serde::Serializer::serialize_unit_variant(
"SerEnum", __serializer,
0u32, "SerEnum",
"Unit", 0u32,
), "Unit",
)
}
SerEnum::Seq(ref __field0, ref __field1, ref __field2, ref __field3) => { SerEnum::Seq(ref __field0, ref __field1, ref __field2, ref __field3) => {
let mut __serde_state = match _serde::Serializer::serialize_tuple_variant( let mut __serde_state = match _serde::Serializer::serialize_tuple_variant(
__serializer, __serializer,
@@ -88,12 +90,7 @@ const _: () = {
}; };
_serde::ser::SerializeTupleVariant::end(__serde_state) _serde::ser::SerializeTupleVariant::end(__serde_state)
} }
SerEnum::Map { SerEnum::Map { ref a, ref b, ref c, ref d } => {
ref a,
ref b,
ref c,
ref d,
} => {
let mut __serde_state = match _serde::Serializer::serialize_struct_variant( let mut __serde_state = match _serde::Serializer::serialize_struct_variant(
__serializer, __serializer,
"SerEnum", "SerEnum",
@@ -148,13 +145,20 @@ const _: () = {
}; };
_serde::ser::SerializeStructVariant::end(__serde_state) _serde::ser::SerializeStructVariant::end(__serde_state)
} }
SerEnum::_Unit2 => _serde::Serializer::serialize_unit_variant( SerEnum::_Unit2 => {
__serializer, _serde::Serializer::serialize_unit_variant(
"SerEnum", __serializer,
3u32, "SerEnum",
"_Unit2", 3u32,
), "_Unit2",
SerEnum::_Seq2(ref __field0, ref __field1, ref __field2, ref __field3) => { )
}
SerEnum::_Seq2(
ref __field0,
ref __field1,
ref __field2,
ref __field3,
) => {
let mut __serde_state = match _serde::Serializer::serialize_tuple_variant( let mut __serde_state = match _serde::Serializer::serialize_tuple_variant(
__serializer, __serializer,
"SerEnum", "SerEnum",
@@ -205,12 +209,7 @@ const _: () = {
}; };
_serde::ser::SerializeTupleVariant::end(__serde_state) _serde::ser::SerializeTupleVariant::end(__serde_state)
} }
SerEnum::_Map2 { SerEnum::_Map2 { ref a, ref b, ref c, ref d } => {
ref a,
ref b,
ref c,
ref d,
} => {
let mut __serde_state = match _serde::Serializer::serialize_struct_variant( let mut __serde_state = match _serde::Serializer::serialize_struct_variant(
__serializer, __serializer,
"SerEnum", "SerEnum",
+31 -14
View File
@@ -25,7 +25,9 @@ const _: () = {
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 {
fn deserialize<__D>(__deserializer: __D) -> _serde::__private::Result<Self, __D::Error> fn deserialize<__D>(
__deserializer: __D,
) -> _serde::__private::Result<Self, __D::Error>
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
@@ -38,17 +40,27 @@ const _: () = {
&self, &self,
__formatter: &mut _serde::__private::Formatter, __formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result { ) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "variant identifier") _serde::__private::Formatter::write_str(
__formatter,
"variant identifier",
)
} }
fn visit_u64<__E>(self, __value: u64) -> _serde::__private::Result<Self::Value, __E> fn visit_u64<__E>(
self,
__value: u64,
) -> _serde::__private::Result<Self::Value, __E>
where where
__E: _serde::de::Error, __E: _serde::de::Error,
{ {
match __value { match __value {
_ => _serde::__private::Err(_serde::de::Error::invalid_value( _ => {
_serde::de::Unexpected::Unsigned(__value), _serde::__private::Err(
&"variant index 0 <= i < 0", _serde::de::Error::invalid_value(
)), _serde::de::Unexpected::Unsigned(__value),
&"variant index 0 <= i < 0",
),
)
}
} }
} }
fn visit_str<__E>( fn visit_str<__E>(
@@ -59,9 +71,11 @@ const _: () = {
__E: _serde::de::Error, __E: _serde::de::Error,
{ {
match __value { match __value {
_ => _serde::__private::Err(_serde::de::Error::unknown_variant( _ => {
__value, VARIANTS, _serde::__private::Err(
)), _serde::de::Error::unknown_variant(__value, VARIANTS),
)
}
} }
} }
fn visit_bytes<__E>( fn visit_bytes<__E>(
@@ -74,9 +88,9 @@ const _: () = {
match __value { match __value {
_ => { _ => {
let __value = &_serde::__private::from_utf8_lossy(__value); let __value = &_serde::__private::from_utf8_lossy(__value);
_serde::__private::Err(_serde::de::Error::unknown_variant( _serde::__private::Err(
__value, VARIANTS, _serde::de::Error::unknown_variant(__value, VARIANTS),
)) )
} }
} }
} }
@@ -89,7 +103,10 @@ const _: () = {
where where
__D: _serde::Deserializer<'de>, __D: _serde::Deserializer<'de>,
{ {
_serde::Deserializer::deserialize_identifier(__deserializer, __FieldVisitor) _serde::Deserializer::deserialize_identifier(
__deserializer,
__FieldVisitor,
)
} }
} }
struct __Visitor<'de> { struct __Visitor<'de> {
+1
View File
@@ -1,6 +1,7 @@
#[cfg_attr(target_os = "emscripten", ignore)] #[cfg_attr(target_os = "emscripten", ignore)]
#[cfg_attr(not(expandtest), ignore)] #[cfg_attr(not(expandtest), ignore)]
#[rustversion::attr(not(nightly), ignore)] #[rustversion::attr(not(nightly), ignore)]
#[cfg_attr(miri, ignore)]
#[allow(unused_attributes)] #[allow(unused_attributes)]
#[test] #[test]
fn expandtest() { fn expandtest() {
+2
View File
@@ -1,3 +1,5 @@
#![allow(unused_macro_rules)]
use serde_test::Token; use serde_test::Token;
use std::iter; use std::iter;
+3 -1
View File
@@ -1,10 +1,12 @@
#![allow( #![allow(
clippy::cast_lossless, clippy::cast_lossless,
clippy::derive_partial_eq_without_eq,
clippy::from_over_into, clippy::from_over_into,
// Clippy bug: https://github.com/rust-lang/rust-clippy/issues/7422 // Clippy bug: https://github.com/rust-lang/rust-clippy/issues/7422
clippy::nonstandard_macro_braces, clippy::nonstandard_macro_braces,
clippy::too_many_lines, clippy::too_many_lines,
clippy::trivially_copy_pass_by_ref clippy::trivially_copy_pass_by_ref,
clippy::type_repetition_in_bounds
)] )]
use serde::de::{self, MapAccess, Unexpected, Visitor}; use serde::de::{self, MapAccess, Unexpected, Visitor};
+5 -1
View File
@@ -1,4 +1,8 @@
#![allow(clippy::items_after_statements, clippy::used_underscore_binding)] #![allow(
clippy::derive_partial_eq_without_eq,
clippy::items_after_statements,
clippy::used_underscore_binding
)]
use serde::{Deserialize, Deserializer}; use serde::{Deserialize, Deserializer};
use serde_test::{assert_de_tokens, assert_de_tokens_error, Token}; use serde_test::{assert_de_tokens, assert_de_tokens_error, Token};
+1
View File
@@ -1,6 +1,7 @@
#![allow( #![allow(
clippy::cast_lossless, clippy::cast_lossless,
clippy::decimal_literal_representation, clippy::decimal_literal_representation,
clippy::derive_partial_eq_without_eq,
clippy::empty_enum, clippy::empty_enum,
clippy::manual_assert, clippy::manual_assert,
clippy::needless_pass_by_value, clippy::needless_pass_by_value,
+30 -1
View File
@@ -1,6 +1,11 @@
#![allow(clippy::empty_enum, clippy::unreadable_literal)] #![allow(
clippy::derive_partial_eq_without_eq,
clippy::empty_enum,
clippy::unreadable_literal
)]
#![cfg_attr(feature = "unstable", feature(never_type))] #![cfg_attr(feature = "unstable", feature(never_type))]
use serde::de::IntoDeserializer;
use serde::Deserialize; use serde::Deserialize;
use serde_test::{assert_de_tokens_error, Token}; use serde_test::{assert_de_tokens_error, Token};
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
@@ -185,6 +190,16 @@ fn test_i64() {
); );
} }
#[test]
fn test_i128() {
let deserializer = <i128 as IntoDeserializer>::into_deserializer(1);
let error = <&str>::deserialize(deserializer).unwrap_err();
assert_eq!(
error.to_string(),
"invalid type: integer `1` as i128, expected a borrowed string",
);
}
#[test] #[test]
fn test_u8() { fn test_u8() {
let test = assert_de_tokens_error::<u8>; let test = assert_de_tokens_error::<u8>;
@@ -326,6 +341,13 @@ fn test_u64() {
&[Token::I64(-1)], &[Token::I64(-1)],
"invalid value: integer `-1`, expected u64", "invalid value: integer `-1`, expected u64",
); );
let deserializer = <u64 as IntoDeserializer>::into_deserializer(1);
let error = <&str>::deserialize(deserializer).unwrap_err();
assert_eq!(
error.to_string(),
"invalid type: integer `1`, expected a borrowed string",
);
} }
#[test] #[test]
@@ -349,6 +371,13 @@ fn test_u128() {
&[Token::I64(-1)], &[Token::I64(-1)],
"invalid value: integer `-1`, expected u128", "invalid value: integer `-1`, expected u128",
); );
let deserializer = <u128 as IntoDeserializer>::into_deserializer(1);
let error = <&str>::deserialize(deserializer).unwrap_err();
assert_eq!(
error.to_string(),
"invalid type: integer `1` as u128, expected a borrowed string",
);
} }
#[test] #[test]
+3 -1
View File
@@ -6,6 +6,7 @@
#![allow( #![allow(
unknown_lints, unknown_lints,
mixed_script_confusables, mixed_script_confusables,
clippy::derive_partial_eq_without_eq,
clippy::items_after_statements, clippy::items_after_statements,
clippy::missing_errors_doc, clippy::missing_errors_doc,
clippy::missing_panics_doc, clippy::missing_panics_doc,
@@ -14,7 +15,8 @@
clippy::nonstandard_macro_braces, clippy::nonstandard_macro_braces,
clippy::ptr_arg, clippy::ptr_arg,
clippy::too_many_lines, clippy::too_many_lines,
clippy::trivially_copy_pass_by_ref clippy::trivially_copy_pass_by_ref,
clippy::type_repetition_in_bounds
)] )]
use serde::de::DeserializeOwned; use serde::de::DeserializeOwned;
+3
View File
@@ -1,4 +1,7 @@
//! Tests for `#[serde(field_identifier)]` and `#[serde(variant_identifier)]` //! Tests for `#[serde(field_identifier)]` and `#[serde(variant_identifier)]`
#![allow(clippy::derive_partial_eq_without_eq)]
use serde::Deserialize; use serde::Deserialize;
use serde_test::{assert_de_tokens, Token}; use serde_test::{assert_de_tokens, Token};
+2
View File
@@ -1,3 +1,5 @@
#![allow(clippy::derive_partial_eq_without_eq)]
use serde::de::value::{Error, MapDeserializer, SeqDeserializer}; use serde::de::value::{Error, MapDeserializer, SeqDeserializer};
use serde::de::{ use serde::de::{
DeserializeSeed, EnumAccess, IgnoredAny, IntoDeserializer, VariantAccess, Visitor, DeserializeSeed, EnumAccess, IgnoredAny, IntoDeserializer, VariantAccess, Visitor,
+1
View File
@@ -1,5 +1,6 @@
#![deny(trivial_numeric_casts)] #![deny(trivial_numeric_casts)]
#![allow( #![allow(
clippy::derive_partial_eq_without_eq,
clippy::enum_variant_names, clippy::enum_variant_names,
clippy::redundant_field_names, clippy::redundant_field_names,
clippy::too_many_lines clippy::too_many_lines
+5 -8
View File
@@ -1,4 +1,4 @@
#![allow(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 std::cell::RefCell; use std::cell::RefCell;
@@ -800,17 +800,14 @@ fn test_never_result() {
#[test] #[test]
#[cfg(unix)] #[cfg(unix)]
fn test_cannot_serialize_paths() { fn test_cannot_serialize_paths() {
let path = unsafe { str::from_utf8_unchecked(b"Hello \xF0\x90\x80World") }; use std::ffi::OsStr;
use std::os::unix::ffi::OsStrExt;
assert_ser_tokens_error( assert_ser_tokens_error(
&Path::new(path), &Path::new(OsStr::from_bytes(b"Hello \xF0\x90\x80World")),
&[], &[],
"path contains invalid UTF-8 characters", "path contains invalid UTF-8 characters",
); );
let mut path_buf = PathBuf::new();
path_buf.push(path);
assert_ser_tokens_error(&path_buf, &[], "path contains invalid UTF-8 characters");
} }
#[test] #[test]
+1
View File
@@ -1,4 +1,5 @@
#![deny(warnings)] #![deny(warnings)]
#![allow(clippy::derive_partial_eq_without_eq)]
// This test target is convoluted with the actual #[test] in a separate file to // This test target is convoluted with the actual #[test] in a separate file to
// get it so that the stable compiler does not need to parse the code of the // get it so that the stable compiler does not need to parse the code of the
+1 -1
View File
@@ -1,4 +1,4 @@
#![allow(clippy::similar_names)] #![allow(clippy::derive_partial_eq_without_eq, clippy::similar_names)]
use serde::de::value::{self, MapAccessDeserializer}; use serde::de::value::{self, MapAccessDeserializer};
use serde::de::{IntoDeserializer, MapAccess, Visitor}; use serde::de::{IntoDeserializer, MapAccess, Visitor};
@@ -3,7 +3,14 @@ error[E0308]: mismatched types
| |
7 | #[derive(Deserialize)] 7 | #[derive(Deserialize)]
| ^^^^^^^^^^^ expected `u16`, found `u8` | ^^^^^^^^^^^ expected `u16`, found `u8`
8 | #[serde(remote = "remote::S")]
| ----------- arguments to this struct are incorrect
| |
note: tuple struct defined here
--> tests/ui/remote/wrong_de.rs:4:16
|
4 | pub struct S(pub u16);
| ^
= note: this error originates in the derive macro `Deserialize` (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)
help: you can convert a `u8` to a `u16` help: you can convert a `u8` to a `u16`
| |
@@ -2,8 +2,16 @@ error[E0308]: mismatched types
--> tests/ui/remote/wrong_getter.rs:15:10 --> tests/ui/remote/wrong_getter.rs:15:10
| |
15 | #[derive(Serialize)] 15 | #[derive(Serialize)]
| ^^^^^^^^^ expected `u8`, found `u16` | ^^^^^^^^^
| |
| expected `u8`, found `u16`
| arguments to this function are incorrect
| |
= note: expected reference `&u8` = note: expected reference `&u8`
found reference `&u16` found reference `&u16`
note: function defined here
--> $WORKSPACE/serde/src/private/ser.rs
|
| pub fn constrain<T: ?Sized>(t: &T) -> &T {
| ^^^^^^^^^
= note: this error originates in the derive macro `Serialize` (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)
+16 -8
View File
@@ -1,9 +1,17 @@
error[E0308]: mismatched types error[E0308]: mismatched types
--> tests/ui/remote/wrong_ser.rs:9:10 --> tests/ui/remote/wrong_ser.rs:9:10
| |
9 | #[derive(Serialize)] 9 | #[derive(Serialize)]
| ^^^^^^^^^ expected `u8`, found `u16` | ^^^^^^^^^
| | |
= note: expected reference `&u8` | expected `u8`, found `u16`
found reference `&u16` | arguments to this function are incorrect
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
= note: expected reference `&u8`
found reference `&u16`
note: function defined here
--> $WORKSPACE/serde/src/private/ser.rs
|
| pub fn constrain<T: ?Sized>(t: &T) -> &T {
| ^^^^^^^^^
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)