Commit Graph

3856 Commits

Author SHA1 Message Date
David Tolnay
6ba9c12ff6
Float copysign does not exist in libcore yet 2023-10-25 19:55:14 -07:00
David Tolnay
d2fcc346b9
Ensure f32 deserialized from f64 and vice versa preserve NaN sign 2023-10-25 19:45:53 -07:00
David Tolnay
a091a07aa2
Add float NaN tests 2023-10-25 19:45:53 -07:00
David Tolnay
bb4135cae8
Fix unused imports
warning: unused imports: `cmp`, `mem`, `slice`
       --> serde/src/lib.rs:171:26
        |
    171 |     pub use self::core::{cmp, iter, mem, num, ptr, slice, str};
        |                          ^^^        ^^^            ^^^^^
        |
        = note: `#[warn(unused_imports)]` on by default
2023-10-24 22:32:42 -07:00
David Tolnay
8de84b7ca3
Resolve get_first clippy lint
warning: accessing first element with `variant.fields.get(0)`
        --> serde_derive/src/de.rs:1843:27
         |
    1843 |             let default = variant.fields.get(0).map(|field| {
         |                           ^^^^^^^^^^^^^^^^^^^^^ help: try: `variant.fields.first()`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
         = note: `-W clippy::get-first` implied by `-W clippy::all`
         = help: to override `-W clippy::all` add `#[allow(clippy::get_first)]`

    warning: accessing first element with `variant.fields.get(0)`
        --> serde_derive/src/de.rs:1888:27
         |
    1888 |             let default = variant.fields.get(0).map(|field| {
         |                           ^^^^^^^^^^^^^^^^^^^^^ help: try: `variant.fields.first()`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
2023-10-21 22:01:10 -07:00
David Tolnay
9cdf332029
Remove 'remember to update' reminder from Cargo.toml 2023-10-17 21:05:31 -07:00
David Tolnay
e94fc65f01
Release 1.0.189 2023-10-12 19:20:43 -07:00
David Tolnay
b908487476
Remove double nesting of first_attempt
`expr` is of type serde_derive::fragment::Expr, which can be
interpolated directly in any expression position. It does not
need to be nested in another set of braces.
2023-10-12 19:18:42 -07:00
David Tolnay
2a7c7faeb4
Merge pull request #2613 from ahl/fix-untagged-plus-simple
"cannot infer type" from Deserialize derive macro with simple variants and untagged variants
2023-10-12 19:15:32 -07:00
David Tolnay
e302e15eea
Merge pull request #2625 from marcospb19/add-csv-to-the-list
Add CSV to the formats list
2023-10-09 19:23:12 -07:00
João Marcos P. Bezerra
1cbea892cf Add CSV to the formats list 2023-10-09 22:59:56 -03:00
David Tolnay
37a32857a2
Update ui test suite to nightly-2023-10-06 2023-10-05 23:24:34 -04:00
David Tolnay
8c4aad3a59
Clean up unneeded raw strings in test 2023-09-26 19:09:30 -07:00
David Tolnay
1774794b19
Resolve needless_raw_string_hashes clippy lint in test
warning: unnecessary hashes around raw string literal
        --> test_suite/tests/test_annotations.rs:2722:9
         |
    2722 |         r#"invalid type: unit value, expected variant identifier"#,
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
         = note: `-W clippy::needless-raw-string-hashes` implied by `-W clippy::all`
         = help: to override `-W clippy::all` add `#[allow(clippy::needless_raw_string_hashes)]`
    help: remove all the hashes around the literal
         |
    2722 -         r#"invalid type: unit value, expected variant identifier"#,
    2722 +         r"invalid type: unit value, expected variant identifier",
         |

    warning: unnecessary hashes around raw string literal
        --> test_suite/tests/test_annotations.rs:2743:9
         |
    2743 |         r#"invalid type: unit value, expected variant identifier"#,
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
    help: remove all the hashes around the literal
         |
    2743 -         r#"invalid type: unit value, expected variant identifier"#,
    2743 +         r"invalid type: unit value, expected variant identifier",
         |

    warning: unnecessary hashes around raw string literal
        --> test_suite/tests/test_annotations.rs:2769:9
         |
    2769 |         r#"invalid type: unit value, expected variant of enum Enum"#,
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
    help: remove all the hashes around the literal
         |
    2769 -         r#"invalid type: unit value, expected variant of enum Enum"#,
    2769 +         r"invalid type: unit value, expected variant of enum Enum",
         |

    warning: unnecessary hashes around raw string literal
        --> test_suite/tests/test_annotations.rs:2782:63
         |
    2782 |     assert_de_tokens_error::<Enum>(&[Token::Str("Untagged")], r#"something strange..."#);
         |                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
    help: remove all the hashes around the literal
         |
    2782 -     assert_de_tokens_error::<Enum>(&[Token::Str("Untagged")], r#"something strange..."#);
    2782 +     assert_de_tokens_error::<Enum>(&[Token::Str("Untagged")], r"something strange...");
         |

    warning: unnecessary hashes around raw string literal
        --> test_suite/tests/test_annotations.rs:2803:9
         |
    2803 |         r#"invalid type: unit value, expected something strange..."#,
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
    help: remove all the hashes around the literal
         |
    2803 -         r#"invalid type: unit value, expected something strange..."#,
    2803 +         r"invalid type: unit value, expected something strange...",
         |

    warning: unnecessary hashes around raw string literal
        --> test_suite/tests/test_annotations.rs:2812:9
         |
    2812 |         r#"invalid type: map, expected something strange..."#,
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
    help: remove all the hashes around the literal
         |
    2812 -         r#"invalid type: map, expected something strange..."#,
    2812 +         r"invalid type: map, expected something strange...",
         |

    warning: unnecessary hashes around raw string literal
        --> test_suite/tests/test_annotations.rs:2817:9
         |
    2817 |         r#"invalid type: unit value, expected something strange..."#,
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
    help: remove all the hashes around the literal
         |
    2817 -         r#"invalid type: unit value, expected something strange..."#,
    2817 +         r"invalid type: unit value, expected something strange...",
         |

    warning: unnecessary hashes around raw string literal
        --> test_suite/tests/test_annotations.rs:2828:9
         |
    2828 |         r#"invalid type: map, expected something strange..."#,
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
    help: remove all the hashes around the literal
         |
    2828 -         r#"invalid type: map, expected something strange..."#,
    2828 +         r"invalid type: map, expected something strange...",
         |
2023-09-26 19:05:18 -07:00
David Tolnay
1af23f1f2d
Test docs.rs documentation build in CI 2023-09-24 10:53:44 -07:00
Adam H. Leventhal
94fbc3d388 fix clippy 2023-09-07 22:17:22 -07:00
Adam H. Leventhal
8da2058e2a fix deserialization of untagged variants within internally or adjacently
tagged enums
2023-09-07 17:19:27 -07:00
Adam H. Leventhal
09993a904a Fix for "cannot infer type" from Deserialize derive macro with simple
variants and untagged variants
2023-09-06 15:33:28 -07:00
Adam H. Leventhal
5d1403461c add failing test 2023-09-06 15:31:16 -07:00
David Tolnay
ddc1ee564b
Release serde_derive_internals 0.29.0 2023-09-06 14:02:05 -07:00
David Tolnay
00a54b848a
Update actions/checkout@v3 -> v4 2023-09-04 22:35:02 -07:00
David Tolnay
dad15b9fd0
Release 1.0.188 2023-08-25 19:16:10 -07:00
David Tolnay
d89c19f903
Revert "Adopt new Cargo feature resolver"
This reverts commit e1c27243b2.

Closes https://github.com/serde-rs/serde/issues/2603.
2023-08-25 19:15:26 -07:00
David Tolnay
146dc0fad5
Release 1.0.187 2023-08-25 10:53:36 -07:00
David Tolnay
d26852deef
Merge pull request #2602 from dtolnay/resolver
Adopt new Cargo feature resolver
2023-08-25 10:52:42 -07:00
David Tolnay
e1c27243b2
Adopt new Cargo feature resolver 2023-08-25 10:35:02 -07:00
David Tolnay
dbbfe7abe2
Merge pull request #2600 from dtolnay/oldemscripten
Remove support for emscripten targets on rustc older than 1.40
2023-08-23 22:18:20 -07:00
David Tolnay
dc24d12ce0
Clean up all usage of serde_if_integer128 2023-08-23 22:14:23 -07:00
David Tolnay
4e7533e872
Remove support for emscripten targets on rustc older than 1.40 2023-08-23 22:07:21 -07:00
David Tolnay
5d036515ed
Release 1.0.186 2023-08-23 17:08:06 -07:00
David Tolnay
a741293886
Merge pull request #2599 from dtolnay/encodeutf8
Remove custom encode_utf8 implementation in favor of standard one
2023-08-23 17:06:39 -07:00
David Tolnay
f8d0b26d2f
Remove custom encode_utf8 implementation in favor of standard one 2023-08-23 17:01:58 -07:00
David Tolnay
7007c1bea5
Merge pull request #2598 from dtolnay/lockstepversion
Duplicate the serde_derive dependency version in one fewer place
2023-08-23 16:34:27 -07:00
David Tolnay
0d8ebac7e1
Duplicate the serde_derive dependency version in one fewer place 2023-08-23 16:29:29 -07:00
David Tolnay
212c42c74f
Merge pull request #2597 from dtolnay/lockstepcomment
Reword PR 2588 comment
2023-08-23 16:29:21 -07:00
David Tolnay
919f6be887
Reword PR 2588 comment 2023-08-23 16:24:14 -07:00
David Tolnay
c0f70428ba
Merge pull request 2588 from soqb:use-impossible-cfg-to-lockstep-serde-derive 2023-08-23 16:17:23 -07:00
David Tolnay
e797c90ebd
Merge pull request #2594 from Uzaaft/master
Fix: Use `&[T]` instead of `&Vec<T>` wherever possible
2023-08-23 16:09:22 -07:00
David Tolnay
fc04d1219a
Remove useless discard of function argument that is used 2023-08-23 16:05:07 -07:00
Uzair Aftab
df4ad5884d Fix: Use &[T] instead of &Vec<T> 2023-08-21 09:44:03 +02:00
David Tolnay
3c7dd6fc1e
Release 1.0.185 2023-08-20 21:41:21 -07:00
David Tolnay
8b196ea1c8
Merge pull request #2592 from dtolnay/remotenonexhaustive
Fix "cannot move out of *self which is behind a shared reference"
2023-08-20 21:40:37 -07:00
David Tolnay
1f8c8ad5a3
Fix "cannot move out of *self which is behind a shared reference" 2023-08-20 21:37:14 -07:00
David Tolnay
870925d503
Add repro of issue 2591
error[E0507]: cannot move out of `*__self` which is behind a shared reference
       --> test_suite/tests/test_remote.rs:210:10
        |
    210 | #[derive(Serialize, Deserialize)]
        |          ^^^^^^^^^
        |          |
        |          data moved here
        |          move occurs because `unrecognized` has type `ErrorKind`, which does not implement the `Copy` trait
        |
        = note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
    help: consider borrowing here
        |
    210 | #[derive(&Serialize, Deserialize)]
        |          +
2023-08-20 21:36:30 -07:00
David Tolnay
d593215ef7
No need for slow macOS CI if there is no platform-specific code 2023-08-20 21:27:07 -07:00
David Tolnay
110af31b48
Merge pull request #2590 from pinkforest/phase-out-precompiled
Phase out precompiled
2023-08-20 21:00:39 -07:00
pinkforest
360606b9a6
Following consensus on: #2580 (review)
This PR phases out the precompiled per final consensus made in #2580
i#
Fix a cfg
2023-08-21 13:53:48 +10:00
David Tolnay
151b45ae36
Release 1.0.184 2023-08-20 19:49:55 -07:00
soqb
2ea7e1300f
guarantee serde is in lockstep with serde_derive 2023-08-21 00:53:22 +01:00
Oli Scherer
4617c957b9
Merge pull request #2587 from wucke13/master
fix shebang in build.sh
2023-08-21 00:22:31 +02:00