serde/test_suite/tests
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
..
bytes Format with rustfmt 0.6.0 2018-04-30 01:42:46 -07:00
compile-fail Add compile-fail tests for transparent error messages 2018-05-20 21:55:50 -07:00
macros Serialize non-human-readble ip addresses as tuples 2017-09-11 15:54:53 +02:00
run-pass License boilerplate 2017-04-13 17:34:42 -07:00
compiletest.rs Replace deprecated compiletest::default_config() 2017-08-15 22:10:18 -07:00
test_annotations.rs Allow multiple flattened maps to see the same fields 2018-06-01 12:50:23 -07:00
test_borrow.rs Auto format attributes on their own line 2017-12-23 20:24:57 -08:00
test_de.rs Test integer128 impls 2018-05-20 22:17:35 -07:00
test_gen.rs Test transparent attribute 2018-05-20 21:55:21 -07:00
test_identifier.rs Auto format attributes on their own line 2017-12-23 20:24:57 -08:00
test_macros.rs Format with rustfmt 0.6.1 2018-05-05 00:56:12 -07:00
test_remote.rs Pretend remote derives are not dead code 2018-05-02 14:23:59 -07:00
test_roundtrip.rs fix some typos 2018-01-03 15:16:45 +01:00
test_ser.rs Test integer128 impls 2018-05-20 22:17:35 -07:00
test_value.rs Implement Copy for value deserializers of primitive types 2018-05-26 15:56:57 -07:00