Commit Graph

3993 Commits

Author SHA1 Message Date
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
wucke13
2547ed83ca fix shebang in build.sh
This fixes #2583.
2023-08-20 23:51:47 +02:00
David Tolnay
bfcd44704f
Discard the possibility of upx compressing binary
This adds too much decompression overhead per invocation.

It could work if the subprocess were reused across multiple macro
expansions (https://github.com/serde-rs/serde/pull/2523).
2023-08-17 19:07:42 -07:00
David Tolnay
7b548db91e
Merge pull request #2572 from serde-rs/cargorm
Adopt `cargo rm` after Cargo bugfix
2023-08-14 04:21:23 -07:00
David Tolnay
d39dea85ad
Adopt 'cargo rm' after Cargo bugfix 2023-08-14 04:12:55 -07:00
David Tolnay
5e56c9fba8
Merge pull request #2570 from dtolnay/remotenonexhaustive
Treat unmatched non-exhaustive remote variant as serde(skip)
2023-08-13 21:20:42 -07:00
David Tolnay
8d3a03288b
Treat unmatched non-exhaustive remote variant as serde(skip) 2023-08-13 21:14:33 -07:00
David Tolnay
cb490ec16d
Add test of remote enum with non_exhaustive 2023-08-13 21:14:12 -07:00
David Tolnay
45271c3676
Resolve ignored_unit_patterns pedantic clippy lint
warning: matching over `()` is more explicit
       --> serde_derive/src/internals/attr.rs:710:33
        |
    710 |         (Some((untagged_tokens, _)), Some((tag_tokens, _)), None) => {
        |                                 ^ help: use `()` instead of `_`: `()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
        = note: `-W clippy::ignored-unit-patterns` implied by `-W clippy::pedantic`

    warning: matching over `()` is more explicit
       --> serde_derive/src/internals/attr.rs:721:33
        |
    721 |         (Some((untagged_tokens, _)), None, Some((content_tokens, _))) => {
        |                                 ^ help: use `()` instead of `_`: `()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns

    warning: matching over `()` is more explicit
       --> serde_derive/src/internals/attr.rs:728:33
        |
    728 |         (Some((untagged_tokens, _)), Some((tag_tokens, _)), Some((content_tokens, _))) => {
        |                                 ^ help: use `()` instead of `_`: `()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns

    warning: matching over `()` is more explicit
       --> serde_derive/src/internals/attr.rs:750:44
        |
    750 |         (_, Some((field_identifier_tokens, _)), Some((variant_identifier_tokens, _))) => {
        |                                            ^ help: use `()` instead of `_`: `()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns

    warning: matching over `()` is more explicit
       --> serde_derive/src/internals/attr.rs:750:82
        |
    750 |         (_, Some((field_identifier_tokens, _)), Some((variant_identifier_tokens, _))) => {
        |                                                                                  ^ help: use `()` instead of `_`: `()`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
2023-08-11 20:27:21 -07:00
Mingun
6a097eca93 Add canary test to ensure that we use adequate enum representation 2023-08-07 20:33:12 +05:00
Mingun
84d1c5385d Use correct tokens in test to represent an enum variant
Unit variant of externally tagged enum cannot be deserialized from the string
token by itself. It is ContentDeserializer + serde_test::Deserializer that makes
this possible, because serde_test::Deserializer produces Content::Str() from
Token::BorrowedStr() and ContentDeserializer produces unit variant from Content::Str().

The following tokens all produces Content::String(variant):
- Token::String(variant)
- Token::Str(variant)
- Token::UnitVariant { variant, .. }

Token::BorrowedStr(variant) produces Content::Str(variant) that was the real purpose to
use it in test in #933. This actually makes this test testing `Content` rather than type itself.

Correct way to represent enum one of:
- [xxxVariant { .. }]
- [Enum { .. }, xxxVariant { variant, .. }]
- [Enum { .. }, String(variant), <variant content>]
- [Enum { .. }, Str(variant), <variant content>]
- [Enum { .. }, BorrowedStr(variant), <variant content>]
2023-08-07 19:19:00 +05:00
David Tolnay
05a5b7e3c6
Release 1.0.183 2023-08-06 21:00:14 -07:00
David Tolnay
3bff326fb3
Merge pull request #2555 from Mingun/field
Refactor code that generates `__Field` enums
2023-08-06 18:23:52 -07:00
David Tolnay
aaadd93878
Merge pull request #2556 from DBLouis/master
Add forward impl for OsStr
2023-08-06 18:02:21 -07:00
Louis Dupré Bertoni
9c864f0b02 Add forward impl for OsStr 2023-08-06 19:41:19 +03:00
Mingun
070cce0d9c Get rid of temporary variable 2023-08-06 19:55:48 +05:00