Commit Graph

814 Commits

Author SHA1 Message Date
David Tolnay
17c3c0cf86
Release 1.0.137 2022-04-30 21:45:31 -07:00
David Tolnay
52391fd868
Inform clippy of supported compiler version in clippy.toml 2022-04-30 20:40:23 -07:00
David Tolnay
b23a768414
Update exhaustive matching to syn 1.0.90 2022-03-28 10:21:37 -07:00
David Tolnay
02bd79a0ba
Release 1.0.136 2022-01-25 13:34:29 -08:00
David Tolnay
8932c852a5
Release 1.0.135 2022-01-22 16:04:17 -08:00
David Tolnay
3bb4a5a4f6
Release 1.0.134 2022-01-20 22:22:30 -08:00
David Tolnay
7af97c66b8
Release 1.0.133 2022-01-01 13:16:35 -08:00
David Tolnay
77ae1c3bf7
Release 1.0.132 2021-12-16 11:06:42 -08:00
David Tolnay
ab1ca04b2e
Release 1.0.131 2021-12-08 18:47:15 -08:00
David Tolnay
fb2fe409c8
Touch up PR 2116 2021-12-08 18:44:41 -08:00
David Tolnay
549fac7235
Merge pull request #2116 from tyranron/fix-unused-results
Fix `unused_results` complaining rustc lint in codegen for adjacently tagged enum
2021-12-08 18:43:31 -08:00
David Tolnay
8f16ac0a94
Move deny(clippy) to command line arguments in the CI job 2021-11-04 20:09:35 -07:00
David Tolnay
4a97386cb9
Clippy if_then_panic lint has been renamed to manual_assert 2021-11-04 19:57:14 -07:00
tyranron
5b32217877
Fix unused_results complaining rustc lint in codegen for adjacently tagged enum 2021-10-29 14:13:26 +03:00
David Tolnay
01ded9f405
Declare minimum Rust version in Cargo metadata 2021-10-02 02:43:22 -04:00
David Tolnay
fc827ecec2
Resolve redundant_closure_for_method_calls clippy lints
error: redundant closure
      --> serde_derive/src/bound.rs:53:19
       |
    53 |         .flat_map(|predicates| predicates.to_vec());
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `[T]::to_vec`
       |
    note: the lint level is defined here
      --> serde_derive/src/lib.rs:18:22
       |
    18 | #![deny(clippy::all, clippy::pedantic)]
       |                      ^^^^^^^^^^^^^^^^
       = note: `#[deny(clippy::redundant_closure_for_method_calls)]` implied by `#[deny(clippy::pedantic)]`
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls

    error: redundant closure
      --> serde_derive/src/bound.rs:75:19
       |
    75 |         .flat_map(|predicates| predicates.to_vec());
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `[T]::to_vec`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
2021-09-30 00:31:49 -04:00
David Tolnay
5c785eee58
Ignore if_then_panic clippy lint
error: only a `panic!` in `if`-then statement
      --> serde_derive/src/internals/ctxt.rs:58:9
       |
    58 | /         if !thread::panicking() && self.errors.borrow().is_some() {
    59 | |             panic!("forgot to check for errors");
    60 | |         }
       | |_________^ help: try: `assert!(!!thread::panicking() && self.errors.borrow().is_some(), "forgot to check for errors");`
       |
    note: the lint level is defined here
      --> serde_derive/src/lib.rs:18:9
       |
    18 | #![deny(clippy::all, clippy::pedantic)]
       |         ^^^^^^^^^^^
       = note: `#[deny(clippy::if_then_panic)]` implied by `#[deny(clippy::all)]`
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_panic

    error: only a `panic!` in `if`-then statement
       --> serde_test/src/assert.rs:73:5
        |
    73  | /     if ser.remaining() > 0 {
    74  | |         panic!("{} remaining tokens", ser.remaining());
    75  | |     }
        | |_____^ help: try: `assert!(!ser.remaining() > 0, "{} remaining tokens", ser.remaining());`
        |
    note: the lint level is defined here
       --> serde_test/src/lib.rs:149:44
        |
    149 | #![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
        |                                            ^^^^^^
        = note: `#[deny(clippy::if_then_panic)]` implied by `#[deny(clippy::all)]`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_panic

    error: only a `panic!` in `if`-then statement
       --> serde_test/src/assert.rs:126:5
        |
    126 | /     if ser.remaining() > 0 {
    127 | |         panic!("{} remaining tokens", ser.remaining());
    128 | |     }
        | |_____^ help: try: `assert!(!ser.remaining() > 0, "{} remaining tokens", ser.remaining());`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_panic

    error: only a `panic!` in `if`-then statement
       --> serde_test/src/assert.rs:166:5
        |
    166 | /     if de.remaining() > 0 {
    167 | |         panic!("{} remaining tokens", de.remaining());
    168 | |     }
        | |_____^ help: try: `assert!(!de.remaining() > 0, "{} remaining tokens", de.remaining());`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_panic

    error: only a `panic!` in `if`-then statement
       --> serde_test/src/assert.rs:180:5
        |
    180 | /     if de.remaining() > 0 {
    181 | |         panic!("{} remaining tokens", de.remaining());
    182 | |     }
        | |_____^ help: try: `assert!(!de.remaining() > 0, "{} remaining tokens", de.remaining());`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_panic

    error: only a `panic!` in `if`-then statement
       --> serde_test/src/assert.rs:220:5
        |
    220 | /     if de.remaining() > 0 {
    221 | |         panic!("{} remaining tokens", de.remaining());
    222 | |     }
        | |_____^ help: try: `assert!(!de.remaining() > 0, "{} remaining tokens", de.remaining());`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_panic

    error: only a `panic!` in `if`-then statement
        --> test_suite/tests/test_de.rs:1349:9
         |
    1349 | /         if de.remaining() > 0 {
    1350 | |             panic!("{} remaining tokens", de.remaining());
    1351 | |         }
         | |_________^ help: try: `assert!(!de.remaining() > 0, "{} remaining tokens", de.remaining());`
         |
         = note: `-D clippy::if-then-panic` implied by `-D clippy::all`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_then_panic
2021-09-30 00:31:49 -04:00
David Tolnay
819db93a3d
Format with rustfmt 2021-09-29 2021-09-30 00:31:49 -04:00
David Tolnay
65e1a50749
Release 1.0.130 2021-08-28 11:31:38 -07:00
David Tolnay
2b92c80cc1
Release 1.0.129 2021-08-23 15:01:24 -07:00
David Tolnay
4a66c5f33d
Support packed remote struct without destructuring 2021-08-23 14:38:33 -07:00
David Tolnay
54102ee7d0
Avoid generating ref patterns for fields of packed remote struct 2021-08-23 10:18:28 -07:00
David Tolnay
9451ea8df1
Format PR 1992 with rustfmt 2021-08-21 12:49:58 -07:00
David Tolnay
c1ce03b3dd
Merge pull request 1992 from Mingun/unnecessary-deserialize-with 2021-08-21 12:49:39 -07:00
David Tolnay
a587eb8953
Release 1.0.128 2021-08-21 10:39:32 -07:00
David Tolnay
f309485787
Ignore buggy collapsible_match clippy lint
https://github.com/rust-lang/rust-clippy/issues/7575
2021-08-16 19:32:10 -07:00
David Tolnay
e2f85681fe
Release 1.0.127 2021-07-30 20:59:13 -07:00
Mingun
e0fc46783d Add test with generic deserialize_with function 2021-06-12 18:47:08 +05:00
Mingun
ca772a14f9 Get rid of useless DeserializeWith wrapper 2021-06-12 18:38:03 +05:00
David Tolnay
7b840897a9
Resolve needless_borrow clippy lints
error: this expression borrows a reference (`&syn::Type`) that is immediately dereferenced by the compiler
       --> serde_derive/src/internals/check.rs:399:37
        |
    399 |     if let Type::Path(ty) = ungroup(&field.ty) {
        |                                     ^^^^^^^^^ help: change this to: `field.ty`
        |
    note: the lint level is defined here
       --> serde_derive/src/lib.rs:18:9
        |
    18  | #![deny(clippy::all, clippy::pedantic)]
        |         ^^^^^^^^^^^
        = note: `#[deny(clippy::needless_borrow)]` implied by `#[deny(clippy::all)]`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> serde_derive/src/de.rs:478:52
        |
    478 |         &type_path, params, fields, false, cattrs, &expecting,
        |                                                    ^^^^^^^^^^ help: change this to: `expecting`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> serde_derive/src/de.rs:564:76
        |
    564 |     let visit_seq = Stmts(deserialize_seq_in_place(params, fields, cattrs, &expecting));
        |                                                                            ^^^^^^^^^^ help: change this to: `expecting`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
       --> serde_derive/src/de.rs:925:51
        |
    925 |         &type_path, params, fields, true, cattrs, &expecting,
        |                                                   ^^^^^^^^^^ help: change this to: `expecting`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&str`) that is immediately dereferenced by the compiler
        --> serde_derive/src/de.rs:1066:76
         |
    1066 |     let visit_seq = Stmts(deserialize_seq_in_place(params, fields, cattrs, &expecting));
         |                                                                            ^^^^^^^^^^ help: change this to: `expecting`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&proc_macro2::TokenStream`) that is immediately dereferenced by the compiler
        --> serde_derive/src/de.rs:2288:80
         |
    2288 |         let fallthrough_borrowed_arm = fallthrough_borrowed.as_ref().unwrap_or(&fallthrough_arm);
         |                                                                                ^^^^^^^^^^^^^^^^ help: change this to: `fallthrough_arm`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&syn::Member`) that is immediately dereferenced by the compiler
        --> serde_derive/src/ser.rs:1102:43
         |
    1102 |                 get_member(params, field, &member)
         |                                           ^^^^^^^ help: change this to: `member`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
2021-06-04 20:58:23 -07:00
David Tolnay
967795414b
Resolve semicolon_if_nothing_returned clippy lints
error: consider adding a `;` to the last statement for consistent formatting
       --> serde_derive/src/internals/attr.rs:559:25
        |
    559 |                         serde_path.set(&m.path, path)
        |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `serde_path.set(&m.path, path);`
        |
    note: the lint level is defined here
       --> serde_derive/src/lib.rs:18:22
        |
    18  | #![deny(clippy::all, clippy::pedantic)]
        |                      ^^^^^^^^^^^^^^^^
        = note: `#[deny(clippy::semicolon_if_nothing_returned)]` implied by `#[deny(clippy::pedantic)]`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    error: consider adding a `;` to the last statement for consistent formatting
        --> serde_derive/src/internals/attr.rs:1612:9
         |
    1612 |         cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()))
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()));`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    error: consider adding a `;` to the last statement for consistent formatting
        --> serde_derive/src/internals/attr.rs:1623:9
         |
    1623 |         cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()))
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()));`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    error: consider adding a `;` to the last statement for consistent formatting
        --> serde_derive/src/internals/attr.rs:1649:9
         |
    1649 | /         cx.error_spanned_by(
    1650 | |             lit,
    1651 | |             format!("failed to parse type: {} = {:?}", attr_name, string.value()),
    1652 | |         )
         | |_________^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
    help: add a `;` here
         |
    1649 |         cx.error_spanned_by(
    1650 |             lit,
    1651 |             format!("failed to parse type: {} = {:?}", attr_name, string.value()),
    1652 |         );
         |

    error: consider adding a `;` to the last statement for consistent formatting
       --> serde_derive/src/internals/check.rs:260:9
        |
    260 | /         cx.error_spanned_by(
    261 | |             cont.original,
    262 | |             format!("variant field name `{}` conflicts with internal tag", tag),
    263 | |         )
        | |_________^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
    help: add a `;` here
        |
    260 |         cx.error_spanned_by(
    261 |             cont.original,
    262 |             format!("variant field name `{}` conflicts with internal tag", tag),
    263 |         );
        |

    error: consider adding a `;` to the last statement for consistent formatting
        --> serde_derive/src/de.rs:2090:9
         |
    2090 |         flat_fields.extend(aliases.iter().map(|alias| (alias, ident)))
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `flat_fields.extend(aliases.iter().map(|alias| (alias, ident)));`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
2021-06-04 20:55:22 -07:00
Dirk Stolle
f68e9e901e fix some typos 2021-05-15 16:18:05 +02:00
David Tolnay
d9c338ec4a
Release 1.0.126 2021-05-12 10:18:26 -07:00
hyd-dev
dd29825217
Allow only unused_extern_crates instead of the whole rust_2018_idioms lint group in serde_derive-generated code 2021-05-12 18:29:45 +08:00
David Tolnay
1120e5af4a
Remove suppression of removed clippy lint
warning: lint `clippy::filter_map` has been removed: this lint has been replaced by `manual_filter_map`, a more specific lint
      --> serde_derive/src/lib.rs:42:5
       |
    42 |     clippy::filter_map,
       |     ^^^^^^^^^^^^^^^^^^
       |
       = note: `#[warn(renamed_and_removed_lints)]` on by default

    warning: lint `clippy::filter_map` has been removed: this lint has been replaced by `manual_filter_map`, a more specific lint
      --> serde_derive/src/lib.rs:42:5
       |
    42 |     clippy::filter_map,
       |     ^^^^^^^^^^^^^^^^^^
2021-04-24 19:23:56 -07:00
David Tolnay
1093f7e232
Resolve flat_map_option pedantic clippy lint
error: used `flat_map` where `filter_map` could be used instead
      --> serde_derive/src/bound.rs:52:10
       |
    52 |         .flat_map(|field| from_field(&field.attrs))
       |          ^^^^^^^^ help: try: `filter_map`
       |
    note: the lint level is defined here
      --> serde_derive/src/lib.rs:18:22
       |
    18 | #![deny(clippy::all, clippy::pedantic)]
       |                      ^^^^^^^^^^^^^^^^
       = note: `#[deny(clippy::flat_map_option)]` implied by `#[deny(clippy::pedantic)]`
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#flat_map_option

    error: used `flat_map` where `filter_map` could be used instead
      --> serde_derive/src/bound.rs:74:10
       |
    74 |         .flat_map(|variant| from_variant(&variant.attrs))
       |          ^^^^^^^^ help: try: `filter_map`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#flat_map_option
2021-04-24 19:23:21 -07:00
David Tolnay
6c3bf7a2fc
Ignore poor suggestion from branches_sharing_code lint
https://github.com/rust-lang/rust-clippy/issues/7054

    error: all if blocks contain the same code at the end
        --> serde_derive/src/de.rs:2160:5
         |
    2160 | /         &fallthrough_arm_tokens
    2161 | |     };
         | |_____^
         |
    note: the lint level is defined here
        --> serde_derive/src/lib.rs:18:9
         |
    18   | #![deny(clippy::all, clippy::pedantic)]
         |         ^^^^^^^^^^^
         = note: `#[deny(clippy::branches_sharing_code)]` implied by `#[deny(clippy::all)]`
         = note: The end suggestion probably needs some adjustments to use the expression result correctly
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#branches_sharing_code
    help: consider moving the end statements out like this
         |
    2160 |     }
    2161 |     &fallthrough_arm_tokens;
         |
2021-04-08 20:08:42 -07:00
David Tolnay
ce0844b9ec
Suppress match_wildcard_for_single_variants clippy false positive
https://github.com/rust-lang/rust-clippy/issues/6984

    error: wildcard matches only a single variant and will also match any future added variants
        --> serde_derive/src/internals/attr.rs:1918:9
         |
    1918 |         _ => {}
         |         ^ help: try this: `syn::Type::__TestExhaustive(_)`
         |
    note: the lint level is defined here
        --> serde_derive/src/lib.rs:18:22
         |
    18   | #![deny(clippy::all, clippy::pedantic)]
         |                      ^^^^^^^^^^^^^^^^
         = note: `#[deny(clippy::match_wildcard_for_single_variants)]` implied by `#[deny(clippy::pedantic)]`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants

    error: wildcard matches only a single variant and will also match any future added variants
       --> serde_derive/src/internals/receiver.rs:153:13
        |
    153 |             _ => {}
        |             ^ help: try this: `Type::__TestExhaustive(_)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants

    error: wildcard matches only a single variant and will also match any future added variants
       --> serde_derive/src/bound.rs:190:17
        |
    190 |                 _ => {}
        |                 ^ help: try this: `syn::Type::__TestExhaustive(_)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants
2021-03-26 23:30:15 -04:00
David Tolnay
e9270e59f0
Release 1.0.125 2021-03-22 16:15:57 -07:00
David Tolnay
5a8dcac2ed
Release 1.0.124 2021-03-05 19:55:40 -08:00
David Tolnay
c261015325
Ignore incorrect suggestion from manual_map lint
https://github.com/rust-lang/rust-clippy/issues/6797

    error[E0382]: use of partially moved value: `self`
       --> serde_derive/src/internals/attr.rs:71:24
        |
    71  |         self.value.map(|value| (self.tokens, value))
        |                    ----^^^^^^^----------------------
        |                    |   |        |
        |                    |   |        use occurs due to use in closure
        |                    |   value used here after partial move
        |                    `self.value` partially moved due to this method call
        |
    note: this function takes ownership of the receiver `self`, which moves `self.value`
       --> /home/david/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:485:38
        |
    485 |     pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Option<U> {
        |                                      ^^^^
        = note: partial move occurs because `self.value` has type `std::option::Option<T>`, which does not implement the `Copy` trait
2021-02-25 20:53:45 -08:00
David Tolnay
6b5e5a83d0
Ignore let_underscore_drop pedantic clippy lint 2021-02-18 19:31:39 -08:00
David Tolnay
3d6c4149b1
Release 1.0.123 2021-01-25 13:43:11 -08:00
David Tolnay
2ba97394fb
Substitute Self in output of Serialize derive 2021-01-25 13:34:09 -08:00
David Tolnay
e5efb6ad93
Remove dependency on syn/visit-mut feature 2021-01-24 23:56:57 -08:00
David Tolnay
1f423580a5
Deduplicate token stream respanner 2021-01-24 23:06:08 -08:00
David Tolnay
033114a4ae
Touch up PR 1830 2021-01-24 23:06:07 -08:00
David Tolnay
7cec99c7fd
Pare down PR 1830
Unlike expr macros, macros in type position in a derive input are rare
enough that it's not worth supporting for an issue that has such an easy
workaround (just replace `Self` in the macro input with your type name).
2021-01-24 23:06:06 -08:00
David Tolnay
6c5bf701be
Merge pull request 1830 from taiki-e/self 2021-01-24 23:05:51 -08:00
David Tolnay
6e800ff826
Test exhaustiveness of type match in collect_lifetimes 2021-01-24 23:04:01 -08:00
David Tolnay
aeee73fe92
Merge pull request #1831 from taiki-e/borrow-macro
Collect lifetimes inside macro invocations
2021-01-24 19:08:20 -08:00
David Tolnay
ffed19243d
Release 1.0.122 2021-01-24 16:17:29 -08:00
David Tolnay
6ea446fb4b
Suppress clippy unused_self pedantic lint
This usage is fine. It's mirroring trait signatures in syn::visit::Visit.

    error: unused `self` argument
       --> serde_derive/src/bound.rs:241:24
        |
    241 |         fn visit_macro(&mut self, _mac: &'ast syn::Macro) {}
        |                        ^^^^^^^^^
        |
    note: the lint level is defined here
       --> serde_derive/src/lib.rs:18:22
        |
    18  | #![deny(clippy::all, clippy::pedantic)]
        |                      ^^^^^^^^^^^^^^^^
        = note: `#[deny(clippy::unused_self)]` implied by `#[deny(clippy::pedantic)]`
        = help: consider refactoring to a associated function
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
2021-01-24 16:01:05 -08:00
David Tolnay
85c6904a93
Remove dependency on syn/visit feature
The builtin visitor is fairly expensive to compile (3700 lines of code),
particularly if something else in the dependency graph also enables
syn/full. For the usage in serde_derive, it turns out to be easy to
replace.
2021-01-24 15:50:41 -08:00
Taiki Endo
e81f54fbc8 Make AST borrow checker happy 2021-01-24 15:23:54 +09:00
Taiki Endo
c67017d466 Fix handling of Self keyword in type definition 2021-01-24 15:23:51 +09:00
David Tolnay
e24dbc418d
Skip another clone of the fallthrough arm 2021-01-23 20:52:03 -08:00
David Tolnay
3728d3c67a
Eliminate duplicated borrowed and non-borrowed identifier deserialization 2021-01-23 20:32:38 -08:00
David Tolnay
b6a2d07f26
Return IdentifierDeserializer to just one associated type
The BorrowedDeserializer was added in #1917, but only makes sense for
&str and &[u8], not for u64 which also needs to be have an
IdentifierDeserializer impl.
2021-01-23 20:04:58 -08:00
David Tolnay
e6b6602a42
Merge pull request 1914 from Mingun/seq-other 2021-01-23 19:50:39 -08:00
David Tolnay
b7bad3a165
Restore compatibility with rustc 1.31 in RenameRule error
str::escape_debug wasn't stabilized until 1.34, whereas serde_derive
currently supports an oldest version of 1.31.
2021-01-23 14:40:44 -08:00
David Tolnay
4e002ece07
Provide list of recognized rename rules on parse error 2021-01-23 14:38:20 -08:00
David Tolnay
eaccae2c46
Fix UPPERCASE rename rule variant to follow idiomatic variant naming
This shouldn't have been named this way in PR #1132.
2021-01-23 14:27:33 -08:00
David Tolnay
990a502c39
Parse rename rules based on table of rules
This will make it possible to reuse the same table of recognized rules
in the parse error message.
2021-01-23 14:24:21 -08:00
David Tolnay
51d4563ed1
Move RenameRule parse error message to a Display impl 2021-01-23 14:13:47 -08:00
David Tolnay
7db0982e58
Add error type to use for RenameRule parsing 2021-01-23 14:09:58 -08:00
David Tolnay
ed04824f10
Move RenameRule parse from trait fn to associated
This will allow updating it to return an Err that borrows the input
string, which is not possible with FromStr.
2021-01-23 14:07:59 -08:00
David Tolnay
a5ecbdb4f4
Merge pull request 1916 from Mingun/expecting-customize 2021-01-23 13:38:45 -08:00
David Tolnay
bd588db067
Release 1.0.121 2021-01-23 13:17:08 -08:00
David Tolnay
34f4b68f77
Fix unneeded clone from PR #1917 2021-01-23 12:40:00 -08:00
David Tolnay
60e08f9545
Format PR #1917 with rustfmt 1.4.32 2021-01-23 12:39:59 -08:00
David Tolnay
ba46f45dc5
Merge pull request 1917 from Mingun/borrow-identifier 2021-01-23 12:39:28 -08:00
David Tolnay
398fba9b1e
Release 1.0.120 2021-01-18 22:55:13 -08:00
David Tolnay
4c89cf89fd
Release 1.0.119 2021-01-11 12:13:57 -08:00
David Tolnay
dd1f4b483e
Make it clearer that the private implementation details are private
Both of these modules are doc(hidden) and commented "Not public API",
but incorrect downstream code sometimes still references them. Naming
the module __private will make it more likely to be noticed in code
review.
2021-01-08 19:55:31 -08:00
David Tolnay
e797431268
Release 1.0.118 2020-12-05 13:45:47 -08:00
David Tolnay
0d5b6c180c
Resolve ptr_eq clippy lint
error: use `std::ptr::eq` when comparing raw pointers
       --> serde_derive/src/de.rs:362:12
        |
    362 |         if field as *const Field == transparent_field as *const Field {
        |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(field, transparent_field)`
        |
    note: the lint level is defined here
       --> serde_derive/src/lib.rs:18:9
        |
    18  | #![deny(clippy::all, clippy::pedantic)]
        |         ^^^^^^^^^^^
        = note: `#[deny(clippy::ptr_eq)]` implied by `#[deny(clippy::all)]`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq
2020-10-27 19:18:29 -07:00
Taiki Endo
a227a87865 Collect lifetimes inside macro invocations 2020-10-24 05:29:47 +09:00
Mingun
7a7a182ab6 Allow borrow for field identifiers 2020-10-23 19:03:18 +05:00
Mingun
104ad9a7dd Allow to define custom expectation message for type with #[serde(expecting = "...")]
Closes #1883
2020-10-23 01:23:01 +05:00
Mingun
0737474640 Allow field identifiers be any numbers if #[serde(other)] is used
Thus behavior synchronized between string/bytes identifiers and numeric identifiers
2020-10-22 16:35:28 +05:00
David Tolnay
fc3f104c4a
Release 1.0.117 2020-10-15 09:49:03 -07:00
David Tolnay
be7d0e7eb2
Ignore map_err_ignore Clippy pedantic lint 2020-09-25 21:55:59 -04:00
David Tolnay
b539cb45d7
Release 1.0.116 2020-09-11 11:56:19 -07:00
David Tolnay
2ef60b62ac
Release 1.0.115 2020-08-10 15:51:19 -07:00
David Tolnay
53b9871b17
Quote no longer requires high recursion 2020-07-16 10:49:16 -07:00
David Tolnay
f8787c3ca8
Suppress match_like_matches_macro clippy lint 2020-07-14 18:57:26 -07:00
David Tolnay
3022064f84
Suppress option_if_let_else clippy pedantic lint 2020-07-14 18:57:24 -07:00
David Tolnay
9c6f0c3a0e
Release 1.0.114 2020-06-21 17:31:02 -07:00
David Tolnay
a9f8ea0a1e
Simplify search for packed repr attr 2020-06-21 17:22:07 -07:00
Tanner Rogalsky
1cd10a7d09 Improved packed repr matching. 2020-06-21 16:46:27 -07:00
David Tolnay
7350b58f5c
Release 1.0.113 2020-06-19 13:31:38 -07:00
David Tolnay
7351e0e55a
Link to feature announcements where available 2020-06-19 13:30:14 -07:00
Taiki Endo
a50e1c20e9 Use underscore consts on Rust 1.37+ 2020-06-19 15:55:43 +09:00
David Tolnay
f3520e526b
Release 1.0.112 2020-06-14 11:16:04 -07:00
David Tolnay
95b1a5d3d9
Ignore unnested_or_patterns suggesting unstable code
Clippy bug: https://github.com/rust-lang/rust-clippy/issues/5704
2020-06-10 19:41:16 -07:00
David Tolnay
0856a2c101
No need to specify Cargo.toml in package.include
Cargo.toml is always included in the published crate.
2020-06-10 01:21:19 -07:00
David Tolnay
9f331cc257
Release 1.0.111 2020-05-29 18:53:07 -07:00
David Tolnay
c45a809d5c
Look inside of None-delimited groups when examining types 2020-05-29 17:58:34 -07:00
David Tolnay
078b171c1b
Release 1.0.110 2020-05-09 23:06:56 -07:00
David Tolnay
da8d6f678e
Simplify finding of repr(packed) attributes 2020-05-09 23:02:49 -07:00
David Tolnay
548eb8f667
Format PR 1791 with rustfmt 2020-05-09 22:54:42 -07:00
David Tolnay
1fe39043ee
Simplify access of packed struct fields in derived Serialize impls 2020-05-09 22:53:38 -07:00
alvardes
9f47c47cad Add support for packed structs. 2020-05-09 22:45:44 -07:00
David Tolnay
dda070f45c
Fix borrow error on pre-NLL compilers
error[E0506]: cannot assign to `missing_content` because it is borrowed
        --> serde_derive/src/de.rs:1414:9
         |
    1388 |           .filter_map(|(i, variant)| {
         |                       -------------- borrow of `missing_content` occurs here
    ...
    1414 | /         missing_content = quote! {
    1415 | |             match __field {
    1416 | |                 #(#missing_content_arms)*
    1417 | |                 #missing_content_fallthrough
    1418 | |             }
    1419 | |         };
         | |_________^ assignment to borrowed `missing_content` occurs here

    error[E0502]: cannot borrow `missing_content_fallthrough` as immutable because it is also borrowed as mutable
        --> serde_derive/src/de.rs:1414:27
         |
    1388 |           .filter_map(|(i, variant)| {
         |                       -------------- mutable borrow occurs here
    ...
    1404 |                       missing_content_fallthrough = quote!(_ => #missing_content);
         |                       --------------------------- previous borrow occurs due to use of `missing_content_fallthrough` in closure
    ...
    1414 |           missing_content = quote! {
         |  ___________________________^
    1415 | |             match __field {
    1416 | |                 #(#missing_content_arms)*
    1417 | |                 #missing_content_fallthrough
    1418 | |             }
    1419 | |         };
         | |_________^ immutable borrow occurs here
    ...
    1622 |   }
         |   - mutable borrow ends here
         |
         = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
2020-05-09 22:37:31 -07:00
David Tolnay
b97a183e82
Release 1.0.109 2020-05-09 21:00:51 -07:00
David Tolnay
9433004307
Omit missing content match if not needed 2020-05-09 20:59:01 -07:00
David Tolnay
9476838264
Omit missing content fallthrough arm if not needed 2020-05-09 20:59:00 -07:00
asdsad
172edc4cf4
Allow optional content field for adjacently tagged newtype variants
* Deserialize adjacently tagged newtype variants with optional content as None instead of erroring when content field is missing

* refactor to remove duplicate code and remove panic
2020-05-09 20:58:28 -07:00
David Tolnay
ea2789df0f
Release 1.0.108 2020-05-09 17:53:23 -07:00
David Tolnay
f63acb52dc
Release 1.0.107 2020-05-08 15:45:36 -07:00
David Tolnay
63809e69c7
Fix indexing bug when skip and other are combined 2020-05-08 15:39:07 -07:00
David Tolnay
60522937af
Remove CI badge from Cargo.toml
Support for badges has been deprecated by crates.io.
2020-05-01 21:11:02 -07:00
David Tolnay
b6def5300a
Resolve redundant_field_names lint in serde_derive 2020-04-05 21:07:52 -07:00
David Tolnay
1b35c9e27e
Update serde_derive to tool attrs 2020-04-05 21:00:58 -07:00
David Tolnay
d1564525ad
Release 1.0.106 2020-04-03 14:26:42 -07:00
robo9k
a135199ab1 Hide generated dummy const in rustdoc 2020-04-03 22:21:38 +02:00
David Tolnay
69653a762d
Release 1.0.105 2020-03-18 11:42:51 -07:00
David Tolnay
078e88b223
Select a single docs.rs build target 2020-03-17 13:31:35 -07:00
David Tolnay
1894cb703f
Resolve clippy question_mark lint 2020-03-05 19:48:07 -08:00
David Tolnay
27c283ab53
Suppress wildcard import pedantic lints 2020-02-26 21:00:12 -08:00
David Tolnay
142955b109
Ignore struct_excessive_bools pedantic lint 2020-02-12 19:34:14 -08:00
David Tolnay
cb1632e957
Fix unused_parens lint
These are left over from a series of unfortunate rustfmt interactions.
ee75e6c0e9 (diff-c052b162f01a664f8184ef1855d1f1cfL767-R735)
cc2558b0dc (diff-c052b162f01a664f8184ef1855d1f1cfL733-R738)
9f38ca032e (diff-c052b162f01a664f8184ef1855d1f1cfL779-R782)
2020-01-25 00:05:15 -08:00
David Tolnay
dfa321a1dd
Ignore wildcard_in_or_patterns lint 2020-01-14 20:31:03 -08:00
David Tolnay
234fbfd7e3
Release 1.0.104 2019-12-15 20:01:04 -08:00
David Tolnay
d540e72fc7
Format with rustfmt 2019-10-07 2019-11-26 00:02:11 -08:00
David Tolnay
43a9f59c18
Release 1.0.103 2019-11-24 16:15:13 -08:00
David Tolnay
2ceabad360
Release 1.0.102 2019-10-27 13:39:27 -07:00
David Tolnay
5db72b8ad9
Ignore must_use_candidate pedantic lint 2019-10-17 11:05:28 -04:00
David Tolnay
d4d737de8d
Resolve redundant_clone lint 2019-10-08 21:16:45 -07:00
David Tolnay
4aba6fae78
Release 1.0.101 2019-09-16 00:32:28 -07:00
David Tolnay
fe06bc2f88
More concise explanation of allow(unused_variables) 2019-09-16 00:31:23 -07:00
David Tolnay
8dfb4cd02f
Merge pull request #1617 from arilotter/master
Fix unused variable warning when field of adjacently tagged enum is skipped
2019-09-15 23:51:39 -07:00
David Tolnay
d1ade37827
Ignore new too_many_lines lint 2019-09-10 23:15:59 -07:00
Ari Lotter
9de49241fb Bug fix for #1610
Allow unused variables in tuple in AdjacentlyTagged serializer
2019-09-09 10:43:05 -04:00
David Tolnay
b24d50160a
Remove use of ref keyword from serde_derive 2019-09-07 23:16:02 -07:00
David Tolnay
a3157c9572
Produce errors on attr that fails to parse as Meta 2019-09-07 22:46:50 -07:00
David Tolnay
0d4722680a
Use flatten() to iterate serde meta items 2019-09-07 22:44:25 -07:00
David Tolnay
7ab12597bb
Un-wrap error message strings for better grepping 2019-09-07 22:40:24 -07:00
David Tolnay
b86a46c83c
Factor skipping in newtype variants into effective_style 2019-09-07 22:16:56 -07:00
David Tolnay
187a0a3ec0
Format with rustfmt 2019-08-19 2019-09-07 22:16:49 -07:00
David Tolnay
111c18dec3
Merge pull request #1622 from Xaeroxe/fix-new-types
Fix (de)serialization of new types where the internal type is skipped
2019-09-07 22:16:40 -07:00
David Tolnay
7a2b137912
Reuse span in default deserialize_with path for Cows 2019-09-07 20:24:59 -07:00
David Tolnay
b6a77c4413
Release 1.0.100 2019-09-07 18:55:50 -07:00
Jake Kiesel
fcbb3d3783 Add support for other enum representations 2019-09-07 11:43:53 -06:00
Jake Kiesel
acc8640c1e Fix (de)serialization of new types where the internal type is skipped 2019-09-07 03:20:43 -06:00
David Tolnay
192f5cd647
Release 1.0.99 2019-08-16 11:50:19 -07:00
David Tolnay
3ea85a28cf
Update to syn/quote 1.0 2019-08-16 11:31:15 -07:00
David Tolnay
de40eb7306
Update serde_derive to use question mark 2019-08-16 11:28:25 -07:00
David Tolnay
668651ee01 Format with rustfmt 2019-07-30 2019-07-31 21:19:46 -07:00
David Tolnay
fb1cacc10e Update Attr structs to hold symbols 2019-07-31 21:06:36 -07:00
David Tolnay
735e56c26f Use symbols when parsing values out of attribute 2019-07-31 21:06:36 -07:00
David Tolnay
97de3dccbb Factor out attr symbols into constants 2019-07-31 21:06:36 -07:00
David Tolnay
690467cbe2
Release 1.0.98 2019-07-28 10:33:34 -07:00
David Tolnay
3ae2bee272
Release 1.0.97 2019-07-17 14:56:51 -07:00
David Tolnay
cf70c3fb05
Format with rustfmt 2019-06-09 2019-07-17 12:27:26 -07:00
David Tolnay
92e0b62c6b
Merge pull request 1526 from fanzeyi/try_from 2019-07-17 12:16:31 -07:00
David Tolnay
cf32a5b204
Release 1.0.96 2019-07-17 12:04:19 -07:00
David Tolnay
da05163d51
Release 1.0.95 2019-07-16 10:08:53 -07:00
David Tolnay
1c1eecabc0
Release 1.0.94 2019-06-27 10:55:12 -07:00
David Tolnay
4cb13b33e0
Release 1.0.93 2019-06-23 12:50:17 -07:00
David Tolnay
89c6a79b6e
Suppress a new pedantic lint 2019-05-31 21:25:36 -07:00
David Tolnay
cd0412bddc
Release 1.0.92 2019-05-31 13:44:01 -07:00
Jonas Platte
e4e110e28f Fix a compile error in derive(Deserialize) with no_std + alloc 2019-05-31 22:16:40 +02:00
David Tolnay
0726623389
Ignore bare_trait_objects lint to support old compilers 2019-05-31 11:34:18 -07:00
Zeyi Fan
4c29eea790 add attribute try_from 2019-05-11 23:31:24 -07:00
David Tolnay
6dd2b4607f
Switch to SPDX 2.1 license expression 2019-05-09 15:21:20 -07:00
David Tolnay
5cc3902ab9
Release 1.0.91 2019-05-06 16:27:04 -07:00
David Tolnay
79a20e9e33
Resolve option_map_unwrap_or_else lint 2019-04-10 22:57:47 -07:00
David Tolnay
0be7f36d51
Release 1.0.90 2019-04-03 09:41:38 -07:00
David Tolnay
4c6cb6e359
Match on serde_path to handle Some(path) and None
I find this a bit easier to follow than map + unwrap_or_else.
2019-04-03 09:40:25 -07:00
David Tolnay
82bde8d166
Format with rustfmt 2019-03-27 2019-04-03 09:40:12 -07:00
David Tolnay
f3c6b9f05a
Simplify signature of Container::serde_path 2019-04-03 09:18:45 -07:00
David Tolnay
2f1945eaf2
Refer directly to serde_path in Deserialize impl
This makes it not a breaking change if we later want to eliminate
the `use #serde_path as _serde;` line.
2019-04-03 09:16:21 -07:00
Sean Griffin
b4d8a55b2a Change serde_path to crate
Also changed the generated code to have at least one thing refer to the
path directly, rather than via `use` -- This shows that the impl *can*
work without `use`, but doesn't actually do all the work to remove the
`use` lines unless we decide we need this feature to work on the 2015
edition
2019-03-28 11:42:50 -06:00
Sean Griffin
0e6ce8fa50 Fix for Rust 1.15 2019-03-20 14:31:49 -06:00
Sean Griffin
a295c38ba3 Allow #[serde(serde_path = "...")] to override extern crate serde
This is intended to be used by other crates which provide their own proc
macros and use serde internally. Today there's no consistent way to put
`#[derive(Deserialize)]` on a struct that consistently works, since
crates may be using either `features = ["derive"]` or relying on
`serde_derive` separately.

Even if we assume that everyone is using `features = ["derive"]`,
without this commit, any crate which generates
`#[derive(serde::Deserialize)]` forces its consumers to put `serde` in
their `Cargo.toml`, even if they aren't otherwise using serde for
anything.

Examples of crates which suffer from this in the real world are
tower-web and swirl.

With this feature, it's expected that these crates would have `pub
extern crate serde;` in some accessible path, and add
`#[serde(serde_path = "that_crate::wherever::serde")]` anywhere they
place serde's derives. Those crates would also have to derive
`that_crate::whatever::serde::Deserialize`, or `use` the macros
explicitly beforehand.

The test for this is a little funky, as it's testing this in a way that
is not the intended use case, or even one we want to support. It has its
own module which re-exports all of serde, but defines its own
`Serialize` and `Deserialize` traits. We then test that we generated
impls for those traits, instead of serde's. The only other way to test
this would be to create a new test crate which does not depend on serde,
but instead depends on `serde_derive` and a third crate which publicly
re-exports serde. This feels like way too much overhead for a single
test case, hence the funky test given.

I didn't see anywhere in this repo to document this attribute, so I
assume the docs will have to be done as a separate PR to a separate
repo.

Fixes #1487
2019-03-18 15:20:19 -06:00
David Tolnay
295730ba1e
Clippy cyclomatic complexity lint has been renamed 2019-03-09 16:36:51 -08:00
David Tolnay
b811588fa0
Release 1.0.89 2019-02-28 17:09:10 -08:00
David Tolnay
58bbaa9e80
Refer to Option through serde::export in generated code 2019-02-28 16:36:17 -08:00
Thomas Eizinger
2ea43c8986 Don't generate code with redundant closures
Fixes #1491.
2019-02-28 17:30:21 +11:00
David Tolnay
64c483cf80
Release 1.0.88 2019-02-15 19:55:50 -08:00
David Tolnay
ef9028d798
Remove conflict between flatten and skip 2019-02-15 18:39:15 -08:00
David Tolnay
1668cd19d3
Eliminate try!(..).value to improve rustfmt'd code
Rustfmt bails out on the original code, leaving it all on one line.
2019-02-13 09:13:50 -08:00
David Tolnay
134f268cee
Release 1.0.87 2019-02-04 07:08:41 +01:00
David Tolnay
c473633676
Format with rustfmt 2018-12-10 2019-02-04 00:39:32 +01:00
David Tolnay
6a3a82007c
Merge pull request #1474 from jwillbold/master
Fixed #1468, flattened struct fields made structs ignore their tag
2019-02-03 15:37:44 -08:00
Johannes Willbold
1d6ef76cfb Fixed #1468, flattened struct fields made structs ignore their tag 2019-02-03 02:09:37 +01:00
David Tolnay
c8e3959435
Release 1.0.86 2019-02-01 21:07:19 -08:00
David Tolnay
fa854a2108
Format with rustfmt 2018-12-10 2019-02-01 21:04:08 -08:00
David Tolnay
bb99b31eb0
Release 1.0.85 2019-01-18 22:36:49 -08:00
David Tolnay
84397183f3
Fix spelling of alises -> aliases 2019-01-18 22:34:23 -08:00
David Tolnay
aeae265777
Simpler way to get single element from vector 2019-01-18 22:33:43 -08:00
David Tolnay
a9c5df5da1
Remove unused Clone on attr::Attr 2019-01-18 22:31:25 -08:00
Lymia Aluysia
8bbc2995ca
Fix clippy lint in serde_derive 2019-01-15 11:35:26 -06:00
Lymia Aluysia
7d3872df57
Fix compilation on Rust 1.15.x 2019-01-15 11:29:55 -06:00
Lymia Aluysia
1ed228b92b
Implements alias annotation and allow multiple deserialization renames. 2019-01-15 11:15:01 -06:00
David Tolnay
fea4e8e5b6
Release 1.0.84 2018-12-31 23:45:34 -05:00
David Tolnay
11cc7014b3
Set all doc tests to 2018 edition 2018-12-31 23:22:13 -05:00
David Tolnay
054ab1adaf
Update serde documentation to 2018 edition 2018-12-31 23:22:11 -05:00
David Tolnay
2f36b26a5c
Clarify that these lints are ignored 2018-12-31 22:49:38 -05:00
David Tolnay
9b4edb3a1d
Address match_ref_pats lint in serde_derive 2018-12-31 22:47:48 -05:00
David Tolnay
b8adc5ffa2
Update name of stutter lint in serde_derive 2018-12-31 22:47:18 -05:00
David Tolnay
bd90cafda7
Ignore trivially_copy_pass_by_ref lint in serde_derive 2018-12-31 22:47:03 -05:00
David Tolnay
eb7250792b
Format with rustfmt 2018-12-10 2018-12-28 12:19:32 -05:00
David Tolnay
7e5066b878
Merge pull request #1450 from motu42/master
Bug fix to support the tag attribute on braced structs with zero fields
2018-12-27 21:48:14 -05:00
Johannes Willbold
889e17816f Bug fix for #1449
Modified serialize_struct_as_struct.
Added test test_internally_tagged_braced_struct_with_zero_fields
2018-12-28 02:50:24 +01:00
David Tolnay
b1b9702daf
Release 1.0.83 2018-12-27 19:53:48 -05:00
David Tolnay
32728d2f1d
Format with rustfmt 2018-12-10 2018-12-27 19:52:26 -05:00
David Tolnay
794ee15386
Merge pull request #1448 from motu42/master
Allow #[serde(tag="...")] on structs
2018-12-27 19:47:28 -05:00
Johannes Willbold
2359417804 Added ui tests, Limited serde(tag = "...") to structs with named field
Added ui test struct-representation/internally-tagged-unit
Added ui test struct-representation/internally-tagged-tuple
    
Limited the serde(tag = "...") to enums and structs with named field
2018-12-28 01:29:33 +01:00
David Tolnay
7950f3cdc5
Format with rustfmt 2018-12-10 2018-12-27 15:35:43 -05:00
David Tolnay
b87f8f35ee
Merge pull request 1447 from vincascm/master 2018-12-27 15:29:16 -05:00
Johannes Willbold
9e53405f43 Fix for rustc 1.15.0 2018-12-27 21:21:46 +01:00
David Tolnay
c6c1d8fa86
Work around deprecation of str::trim_left_matches 2018-12-27 15:20:32 -05:00
Johannes Willbold
414fd694c0 Allowed serde(tag="...") on structs
Added test test_internally_tagged_struct
Renamed EnumTag to TagType as it now also used for structs 
Modified serialize_struct_as_struct
2018-12-27 20:18:36 +01:00
vinoca
7e82809592 Fix tests fail since modify Container attributes rename_all 2018-12-20 14:30:23 +08:00
vinoca
0dae5db30e Support Container attributes rename_all only for Serialize or Deserialize 2018-12-19 09:46:52 +08:00
David Tolnay
5c24f0f0f3
Clean up some indentation that isn't visible to rustfmt 2018-12-10 22:31:39 -08:00
David Tolnay
c2591e9b39
Release 1.0.82 2018-12-10 22:25:27 -08:00
David Tolnay
16daba8ea9
Format with rustfmt 2018-11-30 2018-12-10 22:09:34 -08:00
David Tolnay
85fbd8793a
Support default attr in deserialize_seq_in_place 2018-12-10 22:09:31 -08:00
Tim Ryan
385a385c62 Adds support for the default attr to tuple variants in enums. 2018-12-11 00:02:50 -05:00
David Tolnay
e1edb0282a
Release 1.0.81 2018-12-07 18:30:35 -08:00
hcpl
034db9f20f Improve overall quality of compile_error! errors
Also updates UI tests.
2018-11-30 02:51:49 +02:00
hcpl
8f3f073017 Use more spans for error messages 2018-11-25 16:44:41 +02:00
David Tolnay
58b3af4c29
Copyright/license headers
The following changes are included:

- Delete per-file license notices at the top of each file.
- Delete the first paragraph of LICENSE-MIT (an inaccurate
  pseudo-copyright line), leaving only the text of the MIT license.

Nothing about the license of Serde code has changed, only our
understanding of how to correctly communicate that license has changed.

This mirrors an equivalent change being applied in the rust-lang/rust
repository.
2018-11-24 15:53:09 -08:00
David Tolnay
9afc5fef11
Format with rustfmt 1.0.0-nightly 2018-11-21 01:13:17 -08:00
David Tolnay
451ee2d78e
Clean up calls to into_iter per into_iter_on_ref lint 2018-11-10 20:10:37 -08:00
David Tolnay
1b45e5766a
Release 1.0.80 2018-10-14 03:08:53 -07:00
David Tolnay
6d58492ad0
Fix links to redirected derive documentation 2018-10-03 23:14:49 -07:00
Richard Dodd
80765eb453 Make suggested changes 2018-09-30 15:17:47 +01:00
Richard Dodd
f1073dca04 Make the recommended changed from code review. 2018-09-30 12:34:52 +01:00
Richard Dodd
da65fe5a52 Some docs 2018-09-29 15:06:23 +01:00
David Tolnay
9956589ed5
Release 1.0.79 2018-09-15 14:40:38 -07:00
David Tolnay
81a3f66d78
Ignore unseparated_literal_suffix pedantic lint 2018-09-11 23:08:13 -07:00
David Tolnay
a8247bc619
Sort the ignored lints in serde_derive 2018-09-11 23:08:00 -07:00
David Tolnay
66a9ccb10e
Ignore renamed_and_removed_lints lint
The recommended replacement involving clippy::all has not been
stabilized yet.
2018-09-11 23:05:33 -07:00
David Tolnay
53fe1b328e
Format with rustfmt 0.99.4 2018-09-11 23:00:08 -07:00
roblabla
dcd2232f69 Enforce unit struct for #[serde(other)] 2018-09-11 17:12:37 +00:00
roblabla
61bf901048 Fix for rust 1.15 2018-09-10 17:12:33 +00:00
roblabla
8cc7e6aa90 Implement #serde(other) on enum variant 2018-09-10 15:12:15 +00:00
David Tolnay
7b50388fef
Release 1.0.78 2018-09-08 17:10:41 -07:00
David Tolnay
108cca687c
Release 1.0.77 2018-09-06 21:36:27 -07:00
David Tolnay
b49bd52a53
Use parse_macro_input to report parse errors 2018-09-06 21:16:12 -07:00
David Tolnay
27bd640812
Update to syn 0.15 2018-09-06 21:16:08 -07:00
David Tolnay
98eddf9b29
Update to syn 0.15-rc1 2018-09-01 23:03:59 -07:00
David Tolnay
d23a40c1bb
Format with rustfmt 0.99.2 2018-09-01 23:03:41 -07:00
David Tolnay
55cecace29
Release 1.0.76 2018-09-01 15:25:53 -07:00
David Tolnay
2aab0ce2f6
Release 1.0.75 2018-08-24 23:03:04 -04:00