From b4ef7ac32371b9df0a67b730b399ea1d749019e6 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 16 Mar 2018 01:26:57 +0100 Subject: [PATCH] Updated tests for flatten --- .../conflict/collect-into-wrong-type.rs | 19 ------------------ .../conflict/repr-collect-struct.rs | 20 ------------------- test_suite/tests/test_annotations.rs | 3 ++- 3 files changed, 2 insertions(+), 40 deletions(-) delete mode 100644 test_suite/tests/compile-fail/conflict/collect-into-wrong-type.rs delete mode 100644 test_suite/tests/compile-fail/conflict/repr-collect-struct.rs diff --git a/test_suite/tests/compile-fail/conflict/collect-into-wrong-type.rs b/test_suite/tests/compile-fail/conflict/collect-into-wrong-type.rs deleted file mode 100644 index 4f55cb32..00000000 --- a/test_suite/tests/compile-fail/conflict/collect-into-wrong-type.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2018 Serde Developers -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#[macro_use] -extern crate serde_derive; - -#[derive(Serialize)] //~ ERROR: the trait bound `&std::string::String: std::iter::Iterator` is not satisfied -#[serde(repr = "map", unknown_fields_into="other")] -struct X { - a: u32, - other: String, -} - -fn main() {} diff --git a/test_suite/tests/compile-fail/conflict/repr-collect-struct.rs b/test_suite/tests/compile-fail/conflict/repr-collect-struct.rs deleted file mode 100644 index 6396d32f..00000000 --- a/test_suite/tests/compile-fail/conflict/repr-collect-struct.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2018 Serde Developers -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#[macro_use] -extern crate serde_derive; - -#[derive(Serialize)] //~ ERROR: proc-macro derive panicked -#[serde(repr = "struct", unknown_fields_into="other")] -//~^^ HELP: #[serde(unknown_fields_into)] requires repr="map" -struct X { - a: u32, - other: HashMap, -} - -fn main() {} diff --git a/test_suite/tests/test_annotations.rs b/test_suite/tests/test_annotations.rs index 3686041a..c11b02bb 100644 --- a/test_suite/tests/test_annotations.rs +++ b/test_suite/tests/test_annotations.rs @@ -96,10 +96,11 @@ where } #[derive(Debug, PartialEq, Serialize, Deserialize)] -#[serde(repr="map", unknown_fields_into="extra")] +#[serde(repr="map")] struct CollectOther { a: u32, b: u32, + #[serde(flatten)] extra: HashMap, }