Commit Graph

3805 Commits

Author SHA1 Message Date
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
David Tolnay
7e8f978ca9
Handle $crate special case 2023-07-19 16:32:59 -07:00
David Tolnay
6c0e838a7c
Always consider empty output to be unsuccessful 2023-07-19 16:13:02 -07:00
David Tolnay
d3da41927a
Enable full expression parsing for precompiled serde_derive 2023-07-19 16:01:18 -07:00
David Tolnay
425a4b7a74
Check precompiled subprocess exit status 2023-07-19 16:00:37 -07:00
David Tolnay
63c65ef742
Release 1.0.172 2023-07-19 14:13:56 -07:00
David Tolnay
e838b0bd81
Release 1.0.172-alpha.0 2023-07-19 14:00:50 -07:00
David Tolnay
041e99c78a
Implement fallback to compiling serde_derive from source 2023-07-19 13:53:49 -07:00
David Tolnay
07dcc4f7fe
Remove unneeded 'include' Cargo.toml entries 2023-07-19 13:44:55 -07:00
David Tolnay
b88052d875
Rearrange precompiled directory 2023-07-19 13:24:36 -07:00
David Tolnay
a28292764c
Publish precompiled deserialize_in_place 2023-07-19 12:29:30 -07:00
David Tolnay
2027088741
Support precompiled deserialize_in_place 2023-07-19 12:27:37 -07:00
David Tolnay
e2d8589976
Publish span-related fixes 2023-07-19 09:41:11 -07:00
David Tolnay
c8a9f99d14
Preserve Group span better on compilers without Span::join 2023-07-19 09:39:11 -07:00
David Tolnay
645d04012d
Fix off by one span counter, 0 is used for call_site() 2023-07-19 09:26:56 -07:00
David Tolnay
100ddada2f
Suppress dead_code on fields only accessed by deserialize_in_place
error: field `option` is never read
       --> test_suite/tests/test_gen.rs:666:9
        |
    665 |     struct ImplicitlyBorrowedOption<'a> {
        |            ------------------------ field in this struct
    666 |         option: std::option::Option<&'a str>,
        |         ^^^^^^
        |
    note: the lint level is defined here
       --> test_suite/tests/test_gen.rs:5:9
        |
    5   | #![deny(warnings)]
        |         ^^^^^^^^
        = note: `#[deny(dead_code)]` implied by `#[deny(warnings)]`

    error: fields `ty` and `id` are never read
       --> test_suite/tests/test_gen.rs:696:9
        |
    695 |     struct RelObject<'a> {
        |            --------- fields in this struct
    696 |         ty: &'a str,
        |         ^^
    697 |         id: String,
        |         ^^

    error: field `field` is never read
       --> test_suite/tests/test_gen.rs:740:17
        |
    739 |             struct MacroRules<'a> {
        |                    ---------- field in this struct
    740 |                 field: $field,
        |                 ^^^^^
    ...
    745 |     deriving!(&'a str);
        |     ------------------ in this macro invocation
        |
        = note: this error originates in the macro `deriving` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: field `f` is never read
       --> test_suite/tests/test_gen.rs:756:9
        |
    754 |     struct BorrowLifetimeInsideMacro<'a> {
        |            ------------------------- field in this struct
    755 |         #[serde(borrow = "'a")]
    756 |         f: mac!(Cow<'a, str>),
        |         ^

    warning: fields `question` and `answer` are never read
        --> test_suite/tests/test_annotations.rs:2969:9
         |
    2968 |     struct Struct {
         |            ------ fields in this struct
    2969 |         question: String,
         |         ^^^^^^^^
    2970 |         answer: u32,
         |         ^^^^^^
         |
         = note: `#[warn(dead_code)]` on by default
2023-07-19 09:12:35 -07:00
David Tolnay
2ef1cd4b35
Import macros exclusively through serde_derive in test suite
This makes it easier to execute tests against the precompiled serde_derive.
2023-07-19 09:08:05 -07:00
David Tolnay
be9c3fd69d
Publish raw string fix 2023-07-18 18:42:54 -07:00
David Tolnay
ef522e1d16
Add a reminder about trim-paths 2023-07-18 18:39:40 -07:00
David Tolnay
1ddb6c2fdb
Fix handling of raw idents in proc-macro2 shim 2023-07-18 18:29:24 -07:00
David Tolnay
eb3f2329af
Merge pull request #2514 from dtolnay/precompiled
Add experiment to produce precompiled builds of serde_derive
2023-07-18 13:48:17 -07:00
David Tolnay
9e8f14816b
Add experiment to produce precompiled builds of serde_derive 2023-07-18 13:37:36 -07:00