Commit Graph

215 Commits

Author SHA1 Message Date
David Tolnay
1175d54fb7
Stabilize raw_identifiers 2018-08-24 19:49:13 -04:00
David Tolnay
a3ae14d090
Test raw identifiers 2018-08-22 21:09:37 -04:00
David Tolnay
5985b7edaf
Format with rustfmt 0.99.2 2018-08-14 19:59:20 -07:00
David Tolnay
d28a0e66c8
Fix old reference to serde_codegen 2018-08-12 10:54:59 -07:00
David Tolnay
0ca4db1616
Move untagged borrow test case into codegen tests 2018-08-12 10:54:29 -07:00
David Tolnay
72b3438dfc
Merge pull request #1338 from toidiu/ak-untagged-enum
test borrowing untagged enum
2018-08-12 10:49:15 -07:00
David Tolnay
e26960f7f8
Remove useless run-pass test
When originally added, this test used to contain a `#![plugin(clippy)]`.
This was removed at some point along the way, at which point this test
no longer tests anything. It prints:

    warning: unknown lint: `identity_op`
     --> src/main.rs:1:9
      |
    1 | #![deny(identity_op)]
      |         ^^^^^^^^^^^
      |
      = note: #[warn(unknown_lints)] on by default

which is swallowed and ignored by compiletest.

Nowadays Clippy handles warnings inside of macro expanded code
intelligently and this is something they would be responsible for
testing.
2018-08-06 22:57:46 -07:00
David Tolnay
28db9d4989
Format with rustfmt 0.99.1 2018-08-06 22:40:28 -07:00
Caio
8b2e6baf78 Implement Serialize and Deserialize for RangeInclusive 2018-08-05 10:45:50 -03:00
toidiu
3ca0597a7e test borrowing untagged enum 2018-07-12 17:12:27 -04:00
David Tolnay
4e54aaf796
Format with rustfmt 0.8.2 2018-07-08 19:02:44 -07:00
David Tolnay
84e384196d
Implement Serialize for core::fmt::Arguments 2018-06-26 23:58:16 -07:00
David Tolnay
94853752a1
Stabilize some unstable tests in test suite 2018-06-03 00:31:20 -07:00
David Tolnay
22b1af7eb3
Test never_type 2018-06-03 00:22:11 -07:00
David Tolnay
0a71fe329c
Format the compile-test sources with rustfmt 0.8.2 2018-06-02 22:30:55 -07:00
David Tolnay
a4acc83282
Place compile-fail expected errors on their own line 2018-06-02 22:28:05 -07:00
David Tolnay
7ad3d17e59
Merge pull request #1297 from adamcrume/master
Use compile_error! instead of panicking
2018-06-02 22:00:24 -07:00
Adam Crume
05e931b9a5 Update tests and use quote! macro 2018-06-02 21:11:42 -07:00
David Tolnay
d5ec3efe49
Merge pull request #1299 from dtolnay/flattenmap
Allow multiple flattened maps to see the same fields
2018-06-01 13:00:45 -07:00
David Tolnay
5ee2fc0562
Allow multiple flattened maps to see the same fields
Before this change, flattening anything after a flattened map was
nonsensical because the later flattened field would always observe no
input fields.

    #[derive(Deserialize)]
    struct S {
        #[serde(flatten)]
        map: Map<K, V>,
        #[serde(flatten)]
        other: Other, // always empty
    }

This change makes a flattened map not consume any of the input fields,
leaving them available to later flattened fields in the same struct. The
new behavior is useful when two flattened fields that both use
deserialize_map care about disjoint subsets of the fields in the input.

    #[derive(Deserialize)]
    struct S {
        // Looks at fields with a "player1_" prefix.
        #[serde(flatten, with = "prefix_player1")]
        player1: Player,
        // Looks at fields with a "player2_" prefix.
        #[serde(flatten, with = "prefix_player2")]
        player2: Player,
    }
2018-06-01 12:50:23 -07:00
Konrad Borowski
c3b9ee314b Use try_borrow for serializing RefCell 2018-06-01 09:09:40 +02:00
David Tolnay
927ec7d38e
Implement Copy for value deserializers of primitive types 2018-05-26 15:56:57 -07:00
David Tolnay
ea118e11a0
Test the 128-bit IntoDeserializer impls 2018-05-26 15:21:37 -07:00
David Tolnay
9083cf4b00
Test integer128 impls 2018-05-20 22:17:35 -07:00
David Tolnay
b13875dd97
Add compile-fail tests for transparent error messages 2018-05-20 21:55:50 -07:00
David Tolnay
1335f85213
Test transparent attribute 2018-05-20 21:55:21 -07:00
David Tolnay
4fa2a50f62
Format with rustfmt 0.7.0 2018-05-19 17:33:30 -07:00
David Tolnay
16d1265e17
Fix generated code for deserializing untagged newtype variant 2018-05-19 17:20:14 -07:00
David Tolnay
4305260174
Support flattened untagged Options in struct fields 2018-05-11 22:14:16 -07:00
David Tolnay
368961e961
Support deserializing flattened untagged enum 2018-05-10 08:33:47 -07:00
David Tolnay
b2b36e1764
Accept implicitly borrowed data inside of Option 2018-05-08 12:19:09 -07:00
David Tolnay
4ad140ea70
Improve error for struct deserialized from array that is too short 2018-05-08 12:03:35 -07:00
David Tolnay
67777eb585
Account for skip_serializing_if in tuple struct length 2018-05-08 11:49:37 -07:00
David Tolnay
b4e51fcc77
Respect skip_serializing in tuple structs and variants 2018-05-08 11:37:52 -07:00
David Tolnay
be7fe2a5eb
Introduce bound attribute on enum variants 2018-05-08 11:16:10 -07:00
David Tolnay
c4181f46be
Respect variant skip attribute in inferred bounds 2018-05-07 21:30:00 -07:00
David Tolnay
7e3efaf6c5
Improve error when a 'de lifetime parameter already exists 2018-05-07 21:15:44 -07:00
David Tolnay
12fe42ed45
Support empty adjacently tagged enum 2018-05-07 21:02:42 -07:00
David Tolnay
0025ef9aba
Detect deserialize on a struct ending in dynamically sized slice 2018-05-07 11:52:59 -07:00
David Tolnay
4687c1b52b
Test Weak deserialize impls 2018-05-07 11:23:18 -07:00
David Tolnay
a58abae193
Test Weak serialize impls 2018-05-07 11:23:17 -07:00
David Tolnay
eecc0870fc
Test for pub(restricted) 2018-05-06 23:22:27 -07:00
David Tolnay
3cd9d071c2
Fix adjacently tagged empty tuple variant or struct variant 2018-05-06 21:50:40 -07:00
David Tolnay
972cc06fed
Format the flatten tests using rustfmt 0.6.1 2018-05-06 21:38:41 -07:00
David Tolnay
2009b4da5f
Remove old flatten in enum compile-fail test 2018-05-06 21:26:40 -07:00
David Tolnay
0b72c86a35
Add tests for flatten in enums 2018-05-06 21:23:20 -07:00
David Tolnay
d8120e19bc
Support deserializing a flattened internally tagged enum 2018-05-05 21:52:16 -07:00
David Tolnay
97eff8e875
Format with rustfmt 0.6.1 2018-05-05 00:56:12 -07:00
David Tolnay
b78f434086
Pretend remote derives are not dead code 2018-05-02 14:23:59 -07:00
David Tolnay
cb2b92f828
Handle flatten + deserialize_with 2018-05-01 22:25:06 -07:00