Commit Graph

4076 Commits

Author SHA1 Message Date
David Tolnay
ff5442cd9e
Add no-std unstable build in CI 2023-07-28 16:00:07 -07:00
David Tolnay
92d686f9a5
Fix serde:🇩🇪:StdError in no-std unstable build 2023-07-28 15:58:57 -07:00
David Tolnay
7b09cccd77
Merge pull request #2539 from dtolnay/questionmark
Replace `try!` with `?` in serde_derive
2023-07-27 19:20:15 -07:00
David Tolnay
6f1f38d046
Replace 'try!' with '?' in serde_derive 2023-07-27 19:16:11 -07:00
David Tolnay
db8f06467b
Eliminate workaround for pre-1.17 rustc in serde_derive
The oldest compiler supported by serde_derive by this point is 1.56.
2023-07-27 19:05:57 -07:00
David Tolnay
91ec1c290f
Enforce question mark not used in serde crate yet
Question mark regresses compile time by 6.5–7.5%.
2023-07-27 19:02:11 -07:00
David Tolnay
0676673ca5
Release 1.0.177 2023-07-27 10:51:22 -07:00
David Tolnay
7a4335d664
Merge pull request #2536 from jplatte/jplatte/error-span
Update error span for attribute / data kind mismatches
2023-07-27 10:50:26 -07:00
Jonas Platte
31a0e73489
Update error span for attribute / data kind mismatches 2023-07-27 10:47:45 +02:00
David Tolnay
74fe70855f
Ignore return_self_not_must_use pedantic clippy lint
warning: missing `#[must_use]` attribute on a method returning `Self`
       --> serde_derive_internals/src/attr.rs:204:5
        |
    204 | /     pub fn or(self, other_rules: Self) -> Self {
    205 | |         Self {
    206 | |             serialize: self.serialize.or(other_rules.serialize),
    207 | |             deserialize: self.deserialize.or(other_rules.deserialize),
    208 | |         }
    209 | |     }
        | |_____^
        |
        = help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
        = note: `-W clippy::return-self-not-must-use` implied by `-W clippy::pedantic`

    warning: missing `#[must_use]` attribute on a method returning `Self`
       --> serde_derive_internals/src/case.rs:112:5
        |
    112 | /     pub fn or(self, rule_b: Self) -> Self {
    113 | |         match self {
    114 | |             None => rule_b,
    115 | |             _ => self,
    116 | |         }
    117 | |     }
        | |_____^
        |
        = help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
2023-07-27 00:51:57 -07:00
David Tolnay
e74925bc43
Merge pull request #1695 from jplatte/rename_all_fields
Add #[serde(rename_all_fields = "foo")] attribute
2023-07-27 00:45:45 -07:00
Jonas Platte
56be1c203e
Pass RenameRule, RenameAllRules by value 2023-07-27 09:19:42 +02:00
Jonas Platte
2f9bf4d3eb
Add #[serde(rename_all_fields = "foo")] attribute 2023-07-27 09:19:42 +02:00
David Tolnay
ad94aed753
Merge pull request #2535 from dtolnay/baretrait
Restore bare_trait_objects lint within serde_derive code
2023-07-26 14:26:02 -07:00
David Tolnay
30db83fc44
Restore bare_trait_objects lint within serde_derive code 2023-07-26 14:18:25 -07:00
David Tolnay
b0f7b00e1f
Resolve manual_string_new pedantic clippy lint
warning: empty String is being created manually
        --> test_suite/tests/test_annotations.rs:2280:29
         |
    2280 |     let data = Data::C { t: "".to_string() };
         |                             ^^^^^^^^^^^^^^ help: consider using: `String::new()`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_string_new
         = note: `-W clippy::manual-string-new` implied by `-W clippy::pedantic`
2023-07-26 13:46:28 -07:00
David Tolnay
7255e192d8
Delete unused statement from PR 2266 test 2023-07-26 13:45:49 -07:00
David Tolnay
2102e1aa42
Format PR 2266 tests with rustfmt 2023-07-26 13:41:56 -07:00
David Tolnay
85d5c1fd38
Release 1.0.176 2023-07-26 13:37:44 -07:00
David Tolnay
b789286bc3
Merge pull request #2266 from flisky/master
fix: don't check skipped variant with internal tag
2023-07-26 13:36:33 -07:00
David Tolnay
a6a8a334f7
Add CI on macOS for the non-precompiled codepath 2023-07-26 01:03:20 -07:00
David Tolnay
78a11a27b6
Skip an extra trip through filesystem on the critical path 2023-07-26 00:58:34 -07:00
David Tolnay
d2d7bad04a
Improve error message on missing serde_derive exe 2023-07-26 00:52:09 -07:00
David Tolnay
b978854258
Eliminate parse_macro_input conflict in precompiled mode 2023-07-26 00:44:55 -07:00
David Tolnay
0fb672a1ef
Eliminate #[macro_use] from serde_derive 2023-07-25 23:23:24 -07:00
David Tolnay
dd9913675d
Ungroup imports 2023-07-25 23:06:34 -07:00
David Tolnay
11677ad926
Merge pull request #2533 from dtolnay/test
Move serde_test out to serde-rs/test
2023-07-25 22:52:36 -07:00
David Tolnay
25a53f10db
Move serde_test out to serde-rs/test 2023-07-25 22:48:39 -07:00
David Tolnay
26e2ef001c
Delete deprecated AsciiExt extension trait import
This has been superseded by inherent methods since Rust 1.26.
2023-07-25 21:07:33 -07:00
David Tolnay
30f79b3b2e
Eliminate 2015-style module system imports from serde_derive 2023-07-25 20:56:19 -07:00
David Tolnay
89f84c2915
Merge pull request #2532 from dtolnay/macrouse
Delete unused serde_derive #[macro_use]
2023-07-25 18:55:14 -07:00
David Tolnay
6882285be0
Move extern crate proc_macro into each possible lib.rs
This makes it slightly more convenient to use the following as a
Reindeer fixup for those that prefer to build from source:

    extra_mapped_srcs = { "src/lib_from_source.rs" = "src/lib.rs" }

    [platform_fixups.'cfg(all(target_arch = "x86_64", target_os = "linux", target_env = "gnu"))']
    extra_deps = [":proc-macro2", ":quote", ":syn"]

as opposed to checking in a whole new file containing the `extern crate
proc_macro` + `include!("lib_from_source.rs")`.
2023-07-25 18:54:41 -07:00
David Tolnay
3260bc5896
Delete unused serde_derive #[macro_use]
In old versions of rustc (1.15 through 1.29) it would cause a warning if
this #[macro_use] was not present.

    warning: proc macro crates and `#[no_link]` crates have no effect without `#[macro_use]`
       --> serde/src/lib.rs:340:1
        |
    340 | extern crate serde_derive;
        | ^^^^^^^^^^^^^^^^^^^^^^^^^^

These days serde_derive requires a newer compiler than that, so the
bogus warning would never occur.
2023-07-25 18:47:52 -07:00
David Tolnay
6140b6f527
Release 1.0.175 2023-07-23 20:07:32 -07:00
David Tolnay
4cabc9f293
Merge pull request #2527 from ankane/license-files
Include license files in serde_derive crate
2023-07-23 20:04:18 -07:00
Andrew Kane
aa7c6345a4 Include license files in serde_derive crate 2023-07-23 19:54:57 -07:00
Mingun
f709fc05b0 Do not run the code when results are not used 2023-07-23 15:23:39 +05:00
Mingun
089aae1292 Eliminate even more allocations 2023-07-23 15:23:39 +05:00
Mingun
855acaf112 Eliminate additional allocations for flattening aliases 2023-07-23 15:23:38 +05:00
Mingun
7ca7720262 Slightly reduced number of allocations 2023-07-23 15:23:37 +05:00
Mingun
78fea3aa4a Show possible aliases in the expected message
Fixes tests
2023-07-23 15:23:37 +05:00
Mingun
1efb8b6a53 Add tests for aliases
failures (2):
    field_identifier::unknown
    variant_identifier::unknown
2023-07-23 15:23:36 +05:00
Mingun
bc1960b106 Add tests for unknown field / variant 2023-07-23 15:23:33 +05:00
Mingun
967023b755 Group field_identifier and variant_identifier tests in sub-modules
(review this commit with "ignore whitespace changes" option on)
2023-07-23 15:21:22 +05:00
Mingun
bb51e68f16 Keep aliases sorted 2023-07-23 15:21:21 +05:00
David Tolnay
27414c90a8
Merge pull request #2522 from serde-rs/leak
Leak all memory allocated during macro expansion
2023-07-22 08:37:52 -07:00
David Tolnay
50e2f4b213
Leak all memory allocated during macro expansion 2023-07-22 08:32:18 -07:00
David Tolnay
22be673beb
Release 1.0.174 2023-07-20 22:20:37 -07:00
David Tolnay
166c89fabf
Opt in to generate-link-to-definition when building on docs.rs 2023-07-20 22:19:03 -07:00
David Tolnay
6e0b13eedb
Release 1.0.173 2023-07-19 16:34:13 -07:00