From 40b874214a3a9b64181211b3fa28f290ca973366 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 27 Sep 2016 00:17:00 -0700 Subject: [PATCH] Update tests to new location of errors --- .../tests/compile-fail/duplicate_attributes.rs | 14 +++++++------- .../compile-fail/reject-unknown-attributes.rs | 16 ++++++++-------- serde_macros/tests/compile-fail/str_ref_deser.rs | 4 ++-- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/serde_macros/tests/compile-fail/duplicate_attributes.rs b/serde_macros/tests/compile-fail/duplicate_attributes.rs index 4c1caab2..61c98697 100644 --- a/serde_macros/tests/compile-fail/duplicate_attributes.rs +++ b/serde_macros/tests/compile-fail/duplicate_attributes.rs @@ -1,14 +1,14 @@ #![feature(custom_attribute, custom_derive, plugin)] #![plugin(serde_macros)] -#[derive(Serialize)] +#[derive(Serialize)] //~ ERROR: 6 errors: struct S { #[serde(rename(serialize="x"))] - #[serde(rename(serialize="y"))] //~ ERROR: duplicate serde attribute `rename` + #[serde(rename(serialize="y"))] // ERROR: duplicate serde attribute `rename` a: (), #[serde(rename(serialize="x"))] - #[serde(rename="y")] //~ ERROR: duplicate serde attribute `rename` + #[serde(rename="y")] // ERROR: duplicate serde attribute `rename` b: (), #[serde(rename(serialize="x"))] @@ -16,16 +16,16 @@ struct S { c: (), #[serde(rename="x")] - #[serde(rename(deserialize="y"))] //~ ERROR: duplicate serde attribute `rename` + #[serde(rename(deserialize="y"))] // ERROR: duplicate serde attribute `rename` d: (), - #[serde(rename(serialize="x", serialize="y"))] //~ ERROR: duplicate serde attribute `rename` + #[serde(rename(serialize="x", serialize="y"))] // ERROR: duplicate serde attribute `rename` e: (), - #[serde(rename="x", serialize="y")] //~ ERROR: unknown serde field attribute `serialize = "y"` + #[serde(rename="x", serialize="y")] // ERROR: unknown serde field attribute `serialize` f: (), - #[serde(rename(serialize="x"), rename(serialize="y"))] //~ ERROR: duplicate serde attribute `rename` + #[serde(rename(serialize="x"), rename(serialize="y"))] // ERROR: duplicate serde attribute `rename` g: (), } diff --git a/serde_macros/tests/compile-fail/reject-unknown-attributes.rs b/serde_macros/tests/compile-fail/reject-unknown-attributes.rs index 5a4d2776..9c71fae7 100644 --- a/serde_macros/tests/compile-fail/reject-unknown-attributes.rs +++ b/serde_macros/tests/compile-fail/reject-unknown-attributes.rs @@ -3,27 +3,27 @@ extern crate serde; -#[derive(Serialize)] -#[serde(abc="xyz")] //~ unknown serde container attribute `abc = "xyz"` +#[derive(Serialize)] //~ unknown serde container attribute `abc` +#[serde(abc="xyz")] struct Foo { x: u32, } -#[derive(Deserialize)] -#[serde(abc="xyz")] //~ unknown serde container attribute `abc = "xyz"` +#[derive(Deserialize)] //~ unknown serde container attribute `abc` +#[serde(abc="xyz")] struct Foo { x: u32, } -#[derive(Serialize)] +#[derive(Serialize)] //~ unknown serde field attribute `abc` struct Foo { - #[serde(abc="xyz")] //~ unknown serde field attribute `abc = "xyz"` + #[serde(abc="xyz")] x: u32, } -#[derive(Deserialize)] +#[derive(Deserialize)] //~ unknown serde field attribute `abc` struct Foo { - #[serde(abc="xyz")] //~ unknown serde field attribute `abc = "xyz"` + #[serde(abc="xyz")] x: u32, } diff --git a/serde_macros/tests/compile-fail/str_ref_deser.rs b/serde_macros/tests/compile-fail/str_ref_deser.rs index 827d08c9..610ed680 100644 --- a/serde_macros/tests/compile-fail/str_ref_deser.rs +++ b/serde_macros/tests/compile-fail/str_ref_deser.rs @@ -1,9 +1,9 @@ #![feature(custom_attribute, custom_derive, plugin)] #![plugin(serde_macros)] -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize)] //~ ERROR: Serde does not support deserializing fields of type &str struct Test<'a> { - s: &'a str, //~ ERROR: Serde does not support deserializing fields of type &str + s: &'a str, } fn main() {}