diff --git a/test_suite/tests/compiletest.rs b/test_suite/tests/compiletest.rs index f36a62aa..e388c10c 100644 --- a/test_suite/tests/compiletest.rs +++ b/test_suite/tests/compiletest.rs @@ -11,10 +11,10 @@ extern crate compiletest_rs as compiletest; #[test] -fn compile_fail() { +fn ui() { let config = compiletest::Config { - mode: compiletest::common::Mode::CompileFail, - src_base: std::path::PathBuf::from("tests/compile-fail"), + mode: compiletest::common::Mode::Ui, + src_base: std::path::PathBuf::from("tests/ui"), target_rustcflags: Some("-L deps/target/debug/deps".to_owned()), ..Default::default() }; diff --git a/test_suite/tests/compile-fail/borrow/bad_lifetimes.rs b/test_suite/tests/ui/borrow/bad_lifetimes.rs similarity index 88% rename from test_suite/tests/compile-fail/borrow/bad_lifetimes.rs rename to test_suite/tests/ui/borrow/bad_lifetimes.rs index 174998cd..13242457 100644 --- a/test_suite/tests/compile-fail/borrow/bad_lifetimes.rs +++ b/test_suite/tests/ui/borrow/bad_lifetimes.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Deserialize)] struct Test<'a> { #[serde(borrow = "zzz")] - //~^^^ ERROR: failed to parse borrowed lifetimes: "zzz" s: &'a str, } diff --git a/test_suite/tests/ui/borrow/bad_lifetimes.stderr b/test_suite/tests/ui/borrow/bad_lifetimes.stderr new file mode 100644 index 00000000..b8676ccc --- /dev/null +++ b/test_suite/tests/ui/borrow/bad_lifetimes.stderr @@ -0,0 +1,8 @@ +error: failed to parse borrowed lifetimes: "zzz" + --> $DIR/bad_lifetimes.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/borrow/duplicate_lifetime.rs b/test_suite/tests/ui/borrow/duplicate_lifetime.rs similarity index 90% rename from test_suite/tests/compile-fail/borrow/duplicate_lifetime.rs rename to test_suite/tests/ui/borrow/duplicate_lifetime.rs index b32160a6..5d190b96 100644 --- a/test_suite/tests/compile-fail/borrow/duplicate_lifetime.rs +++ b/test_suite/tests/ui/borrow/duplicate_lifetime.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Deserialize)] struct Test<'a> { #[serde(borrow = "'a + 'a")] - //~^^^ ERROR: duplicate borrowed lifetime `'a` s: &'a str, } diff --git a/test_suite/tests/ui/borrow/duplicate_lifetime.stderr b/test_suite/tests/ui/borrow/duplicate_lifetime.stderr new file mode 100644 index 00000000..ce756d3f --- /dev/null +++ b/test_suite/tests/ui/borrow/duplicate_lifetime.stderr @@ -0,0 +1,8 @@ +error: duplicate borrowed lifetime `'a` + --> $DIR/duplicate_lifetime.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/borrow/duplicate_variant.rs b/test_suite/tests/ui/borrow/duplicate_variant.rs similarity index 91% rename from test_suite/tests/compile-fail/borrow/duplicate_variant.rs rename to test_suite/tests/ui/borrow/duplicate_variant.rs index 93f300b4..c970262a 100644 --- a/test_suite/tests/compile-fail/borrow/duplicate_variant.rs +++ b/test_suite/tests/ui/borrow/duplicate_variant.rs @@ -15,7 +15,6 @@ struct Str<'a>(&'a str); #[derive(Deserialize)] enum Test<'a> { #[serde(borrow)] - //~^^^ ERROR: duplicate serde attribute `borrow` S(#[serde(borrow)] Str<'a>), } diff --git a/test_suite/tests/ui/borrow/duplicate_variant.stderr b/test_suite/tests/ui/borrow/duplicate_variant.stderr new file mode 100644 index 00000000..05835166 --- /dev/null +++ b/test_suite/tests/ui/borrow/duplicate_variant.stderr @@ -0,0 +1,8 @@ +error: duplicate serde attribute `borrow` + --> $DIR/duplicate_variant.rs:15:10 + | +15 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/borrow/empty_lifetimes.rs b/test_suite/tests/ui/borrow/empty_lifetimes.rs similarity index 89% rename from test_suite/tests/compile-fail/borrow/empty_lifetimes.rs rename to test_suite/tests/ui/borrow/empty_lifetimes.rs index a19028da..f10a73f3 100644 --- a/test_suite/tests/compile-fail/borrow/empty_lifetimes.rs +++ b/test_suite/tests/ui/borrow/empty_lifetimes.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Deserialize)] struct Test<'a> { #[serde(borrow = "")] - //~^^^ ERROR: at least one lifetime must be borrowed s: &'a str, } diff --git a/test_suite/tests/ui/borrow/empty_lifetimes.stderr b/test_suite/tests/ui/borrow/empty_lifetimes.stderr new file mode 100644 index 00000000..2c6c9c0b --- /dev/null +++ b/test_suite/tests/ui/borrow/empty_lifetimes.stderr @@ -0,0 +1,8 @@ +error: at least one lifetime must be borrowed + --> $DIR/empty_lifetimes.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/borrow/no_lifetimes.rs b/test_suite/tests/ui/borrow/no_lifetimes.rs similarity index 89% rename from test_suite/tests/compile-fail/borrow/no_lifetimes.rs rename to test_suite/tests/ui/borrow/no_lifetimes.rs index b883997c..c5796069 100644 --- a/test_suite/tests/compile-fail/borrow/no_lifetimes.rs +++ b/test_suite/tests/ui/borrow/no_lifetimes.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Deserialize)] struct Test { #[serde(borrow)] - //~^^^ ERROR: field `s` has no lifetimes to borrow s: String, } diff --git a/test_suite/tests/ui/borrow/no_lifetimes.stderr b/test_suite/tests/ui/borrow/no_lifetimes.stderr new file mode 100644 index 00000000..e2ced937 --- /dev/null +++ b/test_suite/tests/ui/borrow/no_lifetimes.stderr @@ -0,0 +1,8 @@ +error: field `s` has no lifetimes to borrow + --> $DIR/no_lifetimes.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/borrow/struct_variant.rs b/test_suite/tests/ui/borrow/struct_variant.rs similarity index 87% rename from test_suite/tests/compile-fail/borrow/struct_variant.rs rename to test_suite/tests/ui/borrow/struct_variant.rs index 9264efdc..9b16ef61 100644 --- a/test_suite/tests/compile-fail/borrow/struct_variant.rs +++ b/test_suite/tests/ui/borrow/struct_variant.rs @@ -15,7 +15,6 @@ struct Str<'a>(&'a str); #[derive(Deserialize)] enum Test<'a> { #[serde(borrow)] - //~^^^ ERROR: #[serde(borrow)] may only be used on newtype variants S { s: Str<'a> }, } diff --git a/test_suite/tests/ui/borrow/struct_variant.stderr b/test_suite/tests/ui/borrow/struct_variant.stderr new file mode 100644 index 00000000..baa692be --- /dev/null +++ b/test_suite/tests/ui/borrow/struct_variant.stderr @@ -0,0 +1,8 @@ +error: #[serde(borrow)] may only be used on newtype variants + --> $DIR/struct_variant.rs:15:10 + | +15 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/borrow/wrong_lifetime.rs b/test_suite/tests/ui/borrow/wrong_lifetime.rs similarity index 89% rename from test_suite/tests/compile-fail/borrow/wrong_lifetime.rs rename to test_suite/tests/ui/borrow/wrong_lifetime.rs index 42144953..4b3396f7 100644 --- a/test_suite/tests/compile-fail/borrow/wrong_lifetime.rs +++ b/test_suite/tests/ui/borrow/wrong_lifetime.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Deserialize)] struct Test<'a> { #[serde(borrow = "'b")] - //~^^^ ERROR: field `s` does not have lifetime 'b s: &'a str, } diff --git a/test_suite/tests/ui/borrow/wrong_lifetime.stderr b/test_suite/tests/ui/borrow/wrong_lifetime.stderr new file mode 100644 index 00000000..7d20f67d --- /dev/null +++ b/test_suite/tests/ui/borrow/wrong_lifetime.stderr @@ -0,0 +1,8 @@ +error: field `s` does not have lifetime 'b + --> $DIR/wrong_lifetime.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/conflict/adjacent-tag.rs b/test_suite/tests/ui/conflict/adjacent-tag.rs similarity index 85% rename from test_suite/tests/compile-fail/conflict/adjacent-tag.rs rename to test_suite/tests/ui/conflict/adjacent-tag.rs index e4d308c6..74091f64 100644 --- a/test_suite/tests/compile-fail/conflict/adjacent-tag.rs +++ b/test_suite/tests/ui/conflict/adjacent-tag.rs @@ -11,7 +11,6 @@ extern crate serde_derive; #[derive(Serialize)] #[serde(tag = "conflict", content = "conflict")] -//~^^ ERROR: enum tags `conflict` for type and content conflict with each other enum E { A, B, diff --git a/test_suite/tests/ui/conflict/adjacent-tag.stderr b/test_suite/tests/ui/conflict/adjacent-tag.stderr new file mode 100644 index 00000000..713ec75e --- /dev/null +++ b/test_suite/tests/ui/conflict/adjacent-tag.stderr @@ -0,0 +1,8 @@ +error: enum tags `conflict` for type and content conflict with each other + --> $DIR/adjacent-tag.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/conflict/flatten-newtype-struct.rs b/test_suite/tests/ui/conflict/flatten-newtype-struct.rs similarity index 87% rename from test_suite/tests/compile-fail/conflict/flatten-newtype-struct.rs rename to test_suite/tests/ui/conflict/flatten-newtype-struct.rs index 46fdf691..cf6307dd 100644 --- a/test_suite/tests/compile-fail/conflict/flatten-newtype-struct.rs +++ b/test_suite/tests/ui/conflict/flatten-newtype-struct.rs @@ -11,6 +11,5 @@ extern crate serde_derive; #[derive(Serialize)] struct Foo(#[serde(flatten)] HashMap); -//~^^ ERROR: #[serde(flatten)] cannot be used on newtype structs fn main() {} diff --git a/test_suite/tests/ui/conflict/flatten-newtype-struct.stderr b/test_suite/tests/ui/conflict/flatten-newtype-struct.stderr new file mode 100644 index 00000000..45f15ea2 --- /dev/null +++ b/test_suite/tests/ui/conflict/flatten-newtype-struct.stderr @@ -0,0 +1,8 @@ +error: #[serde(flatten)] cannot be used on newtype structs + --> $DIR/flatten-newtype-struct.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/conflict/flatten-skip-deserializing.rs b/test_suite/tests/ui/conflict/flatten-skip-deserializing.rs similarity index 85% rename from test_suite/tests/compile-fail/conflict/flatten-skip-deserializing.rs rename to test_suite/tests/ui/conflict/flatten-skip-deserializing.rs index a9e246e2..fe7a30ad 100644 --- a/test_suite/tests/compile-fail/conflict/flatten-skip-deserializing.rs +++ b/test_suite/tests/ui/conflict/flatten-skip-deserializing.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Deserialize)] struct Foo { #[serde(flatten, skip_deserializing)] - //~^^^ ERROR: #[serde(flatten] can not be combined with #[serde(skip_deserializing)] other: Other, } diff --git a/test_suite/tests/ui/conflict/flatten-skip-deserializing.stderr b/test_suite/tests/ui/conflict/flatten-skip-deserializing.stderr new file mode 100644 index 00000000..771011b2 --- /dev/null +++ b/test_suite/tests/ui/conflict/flatten-skip-deserializing.stderr @@ -0,0 +1,8 @@ +error: #[serde(flatten] can not be combined with #[serde(skip_deserializing)] + --> $DIR/flatten-skip-deserializing.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/conflict/flatten-skip-serializing-if.rs b/test_suite/tests/ui/conflict/flatten-skip-serializing-if.rs similarity index 85% rename from test_suite/tests/compile-fail/conflict/flatten-skip-serializing-if.rs rename to test_suite/tests/ui/conflict/flatten-skip-serializing-if.rs index d5dd1d36..22cd9a26 100644 --- a/test_suite/tests/compile-fail/conflict/flatten-skip-serializing-if.rs +++ b/test_suite/tests/ui/conflict/flatten-skip-serializing-if.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Serialize)] struct Foo { #[serde(flatten, skip_serializing_if = "Option::is_none")] - //~^^^ ERROR: #[serde(flatten] can not be combined with #[serde(skip_serializing_if = "...")] other: Option, } diff --git a/test_suite/tests/ui/conflict/flatten-skip-serializing-if.stderr b/test_suite/tests/ui/conflict/flatten-skip-serializing-if.stderr new file mode 100644 index 00000000..e450d594 --- /dev/null +++ b/test_suite/tests/ui/conflict/flatten-skip-serializing-if.stderr @@ -0,0 +1,8 @@ +error: #[serde(flatten] can not be combined with #[serde(skip_serializing_if = "...")] + --> $DIR/flatten-skip-serializing-if.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/conflict/flatten-skip-serializing.rs b/test_suite/tests/ui/conflict/flatten-skip-serializing.rs similarity index 86% rename from test_suite/tests/compile-fail/conflict/flatten-skip-serializing.rs rename to test_suite/tests/ui/conflict/flatten-skip-serializing.rs index f116c777..b378986d 100644 --- a/test_suite/tests/compile-fail/conflict/flatten-skip-serializing.rs +++ b/test_suite/tests/ui/conflict/flatten-skip-serializing.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Serialize)] struct Foo { #[serde(flatten, skip_serializing)] - //~^^^ ERROR: #[serde(flatten] can not be combined with #[serde(skip_serializing)] other: Other, } diff --git a/test_suite/tests/ui/conflict/flatten-skip-serializing.stderr b/test_suite/tests/ui/conflict/flatten-skip-serializing.stderr new file mode 100644 index 00000000..f9d133b0 --- /dev/null +++ b/test_suite/tests/ui/conflict/flatten-skip-serializing.stderr @@ -0,0 +1,8 @@ +error: #[serde(flatten] can not be combined with #[serde(skip_serializing)] + --> $DIR/flatten-skip-serializing.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/conflict/flatten-tuple-struct.rs b/test_suite/tests/ui/conflict/flatten-tuple-struct.rs similarity index 88% rename from test_suite/tests/compile-fail/conflict/flatten-tuple-struct.rs rename to test_suite/tests/ui/conflict/flatten-tuple-struct.rs index 392139be..2e8d3e6c 100644 --- a/test_suite/tests/compile-fail/conflict/flatten-tuple-struct.rs +++ b/test_suite/tests/ui/conflict/flatten-tuple-struct.rs @@ -11,6 +11,5 @@ extern crate serde_derive; #[derive(Serialize)] struct Foo(u32, #[serde(flatten)] HashMap); -//~^^ ERROR: #[serde(flatten)] cannot be used on tuple structs fn main() {} diff --git a/test_suite/tests/ui/conflict/flatten-tuple-struct.stderr b/test_suite/tests/ui/conflict/flatten-tuple-struct.stderr new file mode 100644 index 00000000..a47287ff --- /dev/null +++ b/test_suite/tests/ui/conflict/flatten-tuple-struct.stderr @@ -0,0 +1,8 @@ +error: #[serde(flatten)] cannot be used on tuple structs + --> $DIR/flatten-tuple-struct.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/conflict/internal-tag.rs b/test_suite/tests/ui/conflict/internal-tag.rs similarity index 88% rename from test_suite/tests/compile-fail/conflict/internal-tag.rs rename to test_suite/tests/ui/conflict/internal-tag.rs index 2b95d19a..9d48979b 100644 --- a/test_suite/tests/compile-fail/conflict/internal-tag.rs +++ b/test_suite/tests/ui/conflict/internal-tag.rs @@ -11,7 +11,6 @@ extern crate serde_derive; #[derive(Serialize)] #[serde(tag = "conflict")] -//~^^ ERROR: variant field name `conflict` conflicts with internal tag enum E { A { #[serde(rename = "conflict")] diff --git a/test_suite/tests/ui/conflict/internal-tag.stderr b/test_suite/tests/ui/conflict/internal-tag.stderr new file mode 100644 index 00000000..1bbc68e1 --- /dev/null +++ b/test_suite/tests/ui/conflict/internal-tag.stderr @@ -0,0 +1,8 @@ +error: variant field name `conflict` conflicts with internal tag + --> $DIR/internal-tag.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/default-attribute/enum.rs b/test_suite/tests/ui/default-attribute/enum.rs similarity index 88% rename from test_suite/tests/compile-fail/default-attribute/enum.rs rename to test_suite/tests/ui/default-attribute/enum.rs index d05bbd48..fecc4b76 100644 --- a/test_suite/tests/compile-fail/default-attribute/enum.rs +++ b/test_suite/tests/ui/default-attribute/enum.rs @@ -11,7 +11,6 @@ extern crate serde_derive; #[derive(Deserialize)] #[serde(default)] -//~^^ ERROR: #[serde(default)] can only be used on structs enum E { S { f: u8 }, } diff --git a/test_suite/tests/ui/default-attribute/enum.stderr b/test_suite/tests/ui/default-attribute/enum.stderr new file mode 100644 index 00000000..1e7b0ee6 --- /dev/null +++ b/test_suite/tests/ui/default-attribute/enum.stderr @@ -0,0 +1,8 @@ +error: #[serde(default)] can only be used on structs with named fields + --> $DIR/enum.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/default-attribute/nameless_struct_fields.rs b/test_suite/tests/ui/default-attribute/nameless_struct_fields.rs similarity index 88% rename from test_suite/tests/compile-fail/default-attribute/nameless_struct_fields.rs rename to test_suite/tests/ui/default-attribute/nameless_struct_fields.rs index fbcd0f58..20f3474d 100644 --- a/test_suite/tests/compile-fail/default-attribute/nameless_struct_fields.rs +++ b/test_suite/tests/ui/default-attribute/nameless_struct_fields.rs @@ -11,7 +11,6 @@ extern crate serde_derive; #[derive(Deserialize)] #[serde(default)] -//~^^ ERROR: #[serde(default)] can only be used on structs struct T(u8, u8); fn main() {} diff --git a/test_suite/tests/ui/default-attribute/nameless_struct_fields.stderr b/test_suite/tests/ui/default-attribute/nameless_struct_fields.stderr new file mode 100644 index 00000000..e270b678 --- /dev/null +++ b/test_suite/tests/ui/default-attribute/nameless_struct_fields.stderr @@ -0,0 +1,8 @@ +error: #[serde(default)] can only be used on structs with named fields + --> $DIR/nameless_struct_fields.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/duplicate-attribute/rename-and-ser.rs b/test_suite/tests/ui/duplicate-attribute/rename-and-ser.rs similarity index 88% rename from test_suite/tests/compile-fail/duplicate-attribute/rename-and-ser.rs rename to test_suite/tests/ui/duplicate-attribute/rename-and-ser.rs index 9c4a185c..801699c7 100644 --- a/test_suite/tests/compile-fail/duplicate-attribute/rename-and-ser.rs +++ b/test_suite/tests/ui/duplicate-attribute/rename-and-ser.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Serialize)] struct S { #[serde(rename = "x", serialize = "y")] - //~^^^ ERROR: unknown serde field attribute `serialize` x: (), } diff --git a/test_suite/tests/ui/duplicate-attribute/rename-and-ser.stderr b/test_suite/tests/ui/duplicate-attribute/rename-and-ser.stderr new file mode 100644 index 00000000..f96a8f26 --- /dev/null +++ b/test_suite/tests/ui/duplicate-attribute/rename-and-ser.stderr @@ -0,0 +1,8 @@ +error: unknown serde field attribute `serialize` + --> $DIR/rename-and-ser.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/duplicate-attribute/rename-rename-de.rs b/test_suite/tests/ui/duplicate-attribute/rename-rename-de.rs similarity index 90% rename from test_suite/tests/compile-fail/duplicate-attribute/rename-rename-de.rs rename to test_suite/tests/ui/duplicate-attribute/rename-rename-de.rs index 4cd9aa92..ac7b3ec5 100644 --- a/test_suite/tests/compile-fail/duplicate-attribute/rename-rename-de.rs +++ b/test_suite/tests/ui/duplicate-attribute/rename-rename-de.rs @@ -13,7 +13,6 @@ extern crate serde_derive; struct S { #[serde(rename = "x")] #[serde(rename(deserialize = "y"))] - //~^^^^ ERROR: duplicate serde attribute `rename` x: (), } diff --git a/test_suite/tests/ui/duplicate-attribute/rename-rename-de.stderr b/test_suite/tests/ui/duplicate-attribute/rename-rename-de.stderr new file mode 100644 index 00000000..320952a2 --- /dev/null +++ b/test_suite/tests/ui/duplicate-attribute/rename-rename-de.stderr @@ -0,0 +1,8 @@ +error: duplicate serde attribute `rename` + --> $DIR/rename-rename-de.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/duplicate-attribute/rename-ser-rename-ser.rs b/test_suite/tests/ui/duplicate-attribute/rename-ser-rename-ser.rs similarity index 90% rename from test_suite/tests/compile-fail/duplicate-attribute/rename-ser-rename-ser.rs rename to test_suite/tests/ui/duplicate-attribute/rename-ser-rename-ser.rs index c2bca9be..c99e5166 100644 --- a/test_suite/tests/compile-fail/duplicate-attribute/rename-ser-rename-ser.rs +++ b/test_suite/tests/ui/duplicate-attribute/rename-ser-rename-ser.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Serialize)] struct S { #[serde(rename(serialize = "x"), rename(serialize = "y"))] - //~^^^ ERROR: duplicate serde attribute `rename` x: (), } diff --git a/test_suite/tests/ui/duplicate-attribute/rename-ser-rename-ser.stderr b/test_suite/tests/ui/duplicate-attribute/rename-ser-rename-ser.stderr new file mode 100644 index 00000000..cf7dd996 --- /dev/null +++ b/test_suite/tests/ui/duplicate-attribute/rename-ser-rename-ser.stderr @@ -0,0 +1,8 @@ +error: duplicate serde attribute `rename` + --> $DIR/rename-ser-rename-ser.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/duplicate-attribute/rename-ser-rename.rs b/test_suite/tests/ui/duplicate-attribute/rename-ser-rename.rs similarity index 90% rename from test_suite/tests/compile-fail/duplicate-attribute/rename-ser-rename.rs rename to test_suite/tests/ui/duplicate-attribute/rename-ser-rename.rs index cce37abf..35e0924c 100644 --- a/test_suite/tests/compile-fail/duplicate-attribute/rename-ser-rename.rs +++ b/test_suite/tests/ui/duplicate-attribute/rename-ser-rename.rs @@ -13,7 +13,6 @@ extern crate serde_derive; struct S { #[serde(rename(serialize = "x"))] #[serde(rename = "y")] - //~^^^^ ERROR: duplicate serde attribute `rename` x: (), } diff --git a/test_suite/tests/ui/duplicate-attribute/rename-ser-rename.stderr b/test_suite/tests/ui/duplicate-attribute/rename-ser-rename.stderr new file mode 100644 index 00000000..8a9ea18b --- /dev/null +++ b/test_suite/tests/ui/duplicate-attribute/rename-ser-rename.stderr @@ -0,0 +1,8 @@ +error: duplicate serde attribute `rename` + --> $DIR/rename-ser-rename.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/duplicate-attribute/rename-ser-ser.rs b/test_suite/tests/ui/duplicate-attribute/rename-ser-ser.rs similarity index 90% rename from test_suite/tests/compile-fail/duplicate-attribute/rename-ser-ser.rs rename to test_suite/tests/ui/duplicate-attribute/rename-ser-ser.rs index 38d3f6b7..32040abb 100644 --- a/test_suite/tests/compile-fail/duplicate-attribute/rename-ser-ser.rs +++ b/test_suite/tests/ui/duplicate-attribute/rename-ser-ser.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Serialize)] struct S { #[serde(rename(serialize = "x", serialize = "y"))] - //~^^^ ERROR: duplicate serde attribute `rename` x: (), } diff --git a/test_suite/tests/ui/duplicate-attribute/rename-ser-ser.stderr b/test_suite/tests/ui/duplicate-attribute/rename-ser-ser.stderr new file mode 100644 index 00000000..f175985e --- /dev/null +++ b/test_suite/tests/ui/duplicate-attribute/rename-ser-ser.stderr @@ -0,0 +1,8 @@ +error: duplicate serde attribute `rename` + --> $DIR/rename-ser-ser.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/duplicate-attribute/two-rename-ser.rs b/test_suite/tests/ui/duplicate-attribute/two-rename-ser.rs similarity index 90% rename from test_suite/tests/compile-fail/duplicate-attribute/two-rename-ser.rs rename to test_suite/tests/ui/duplicate-attribute/two-rename-ser.rs index 63ab511f..553e58d9 100644 --- a/test_suite/tests/compile-fail/duplicate-attribute/two-rename-ser.rs +++ b/test_suite/tests/ui/duplicate-attribute/two-rename-ser.rs @@ -13,7 +13,6 @@ extern crate serde_derive; struct S { #[serde(rename(serialize = "x"))] #[serde(rename(serialize = "y"))] - //~^^^^ ERROR: duplicate serde attribute `rename` x: (), } diff --git a/test_suite/tests/ui/duplicate-attribute/two-rename-ser.stderr b/test_suite/tests/ui/duplicate-attribute/two-rename-ser.stderr new file mode 100644 index 00000000..a3682108 --- /dev/null +++ b/test_suite/tests/ui/duplicate-attribute/two-rename-ser.stderr @@ -0,0 +1,8 @@ +error: duplicate serde attribute `rename` + --> $DIR/two-rename-ser.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/duplicate-attribute/with-and-serialize-with.rs b/test_suite/tests/ui/duplicate-attribute/with-and-serialize-with.rs similarity index 88% rename from test_suite/tests/compile-fail/duplicate-attribute/with-and-serialize-with.rs rename to test_suite/tests/ui/duplicate-attribute/with-and-serialize-with.rs index c128ef10..603e37e7 100644 --- a/test_suite/tests/compile-fail/duplicate-attribute/with-and-serialize-with.rs +++ b/test_suite/tests/ui/duplicate-attribute/with-and-serialize-with.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Serialize)] struct S { #[serde(with = "w", serialize_with = "s")] - //~^^^ ERROR: duplicate serde attribute `serialize_with` x: (), } diff --git a/test_suite/tests/ui/duplicate-attribute/with-and-serialize-with.stderr b/test_suite/tests/ui/duplicate-attribute/with-and-serialize-with.stderr new file mode 100644 index 00000000..934bc652 --- /dev/null +++ b/test_suite/tests/ui/duplicate-attribute/with-and-serialize-with.stderr @@ -0,0 +1,8 @@ +error: duplicate serde attribute `serialize_with` + --> $DIR/with-and-serialize-with.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/enum-representation/internal-tuple-variant.rs b/test_suite/tests/ui/enum-representation/internal-tuple-variant.rs similarity index 86% rename from test_suite/tests/compile-fail/enum-representation/internal-tuple-variant.rs rename to test_suite/tests/ui/enum-representation/internal-tuple-variant.rs index eb778633..86793f2f 100644 --- a/test_suite/tests/compile-fail/enum-representation/internal-tuple-variant.rs +++ b/test_suite/tests/ui/enum-representation/internal-tuple-variant.rs @@ -11,7 +11,6 @@ extern crate serde_derive; #[derive(Serialize)] #[serde(tag = "type")] -//~^^ ERROR: #[serde(tag = "...")] cannot be used with tuple variants enum E { Tuple(u8, u8), } diff --git a/test_suite/tests/ui/enum-representation/internal-tuple-variant.stderr b/test_suite/tests/ui/enum-representation/internal-tuple-variant.stderr new file mode 100644 index 00000000..c5ced95b --- /dev/null +++ b/test_suite/tests/ui/enum-representation/internal-tuple-variant.stderr @@ -0,0 +1,8 @@ +error: #[serde(tag = "...")] cannot be used with tuple variants + --> $DIR/internal-tuple-variant.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/enum-representation/internally-tagged-struct.rs b/test_suite/tests/ui/enum-representation/internally-tagged-struct.rs similarity index 88% rename from test_suite/tests/compile-fail/enum-representation/internally-tagged-struct.rs rename to test_suite/tests/ui/enum-representation/internally-tagged-struct.rs index e9660e1b..d119570d 100644 --- a/test_suite/tests/compile-fail/enum-representation/internally-tagged-struct.rs +++ b/test_suite/tests/ui/enum-representation/internally-tagged-struct.rs @@ -11,7 +11,6 @@ extern crate serde_derive; #[derive(Serialize)] #[serde(tag = "type")] -//~^^ ERROR: #[serde(tag = "...")] can only be used on enums struct S; fn main() {} diff --git a/test_suite/tests/ui/enum-representation/internally-tagged-struct.stderr b/test_suite/tests/ui/enum-representation/internally-tagged-struct.stderr new file mode 100644 index 00000000..96eb3e1d --- /dev/null +++ b/test_suite/tests/ui/enum-representation/internally-tagged-struct.stderr @@ -0,0 +1,8 @@ +error: #[serde(tag = "...")] can only be used on enums + --> $DIR/internally-tagged-struct.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/enum-representation/untagged-and-internal.rs b/test_suite/tests/ui/enum-representation/untagged-and-internal.rs similarity index 88% rename from test_suite/tests/compile-fail/enum-representation/untagged-and-internal.rs rename to test_suite/tests/ui/enum-representation/untagged-and-internal.rs index b272c0b7..32b125a6 100644 --- a/test_suite/tests/compile-fail/enum-representation/untagged-and-internal.rs +++ b/test_suite/tests/ui/enum-representation/untagged-and-internal.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Serialize)] #[serde(untagged)] #[serde(tag = "type")] -//~^^^ ERROR: enum cannot be both untagged and internally tagged enum E { A(u8), B(String), diff --git a/test_suite/tests/ui/enum-representation/untagged-and-internal.stderr b/test_suite/tests/ui/enum-representation/untagged-and-internal.stderr new file mode 100644 index 00000000..1782b95d --- /dev/null +++ b/test_suite/tests/ui/enum-representation/untagged-and-internal.stderr @@ -0,0 +1,8 @@ +error: enum cannot be both untagged and internally tagged + --> $DIR/untagged-and-internal.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/enum-representation/untagged-struct.rs b/test_suite/tests/ui/enum-representation/untagged-struct.rs similarity index 88% rename from test_suite/tests/compile-fail/enum-representation/untagged-struct.rs rename to test_suite/tests/ui/enum-representation/untagged-struct.rs index 6a7dd3e2..20321ebd 100644 --- a/test_suite/tests/compile-fail/enum-representation/untagged-struct.rs +++ b/test_suite/tests/ui/enum-representation/untagged-struct.rs @@ -11,7 +11,6 @@ extern crate serde_derive; #[derive(Serialize)] #[serde(untagged)] -//~^^ ERROR: #[serde(untagged)] can only be used on enums struct S; fn main() {} diff --git a/test_suite/tests/ui/enum-representation/untagged-struct.stderr b/test_suite/tests/ui/enum-representation/untagged-struct.stderr new file mode 100644 index 00000000..a4615e83 --- /dev/null +++ b/test_suite/tests/ui/enum-representation/untagged-struct.stderr @@ -0,0 +1,8 @@ +error: #[serde(untagged)] can only be used on enums + --> $DIR/untagged-struct.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/identifier/both.rs b/test_suite/tests/ui/identifier/both.rs similarity index 86% rename from test_suite/tests/compile-fail/identifier/both.rs rename to test_suite/tests/ui/identifier/both.rs index c6fda3d6..1ab35b23 100644 --- a/test_suite/tests/compile-fail/identifier/both.rs +++ b/test_suite/tests/ui/identifier/both.rs @@ -11,7 +11,6 @@ extern crate serde_derive; #[derive(Deserialize)] #[serde(field_identifier, variant_identifier)] -//~^^ ERROR: `field_identifier` and `variant_identifier` cannot both be set enum F { A, B, diff --git a/test_suite/tests/ui/identifier/both.stderr b/test_suite/tests/ui/identifier/both.stderr new file mode 100644 index 00000000..51951baa --- /dev/null +++ b/test_suite/tests/ui/identifier/both.stderr @@ -0,0 +1,8 @@ +error: `field_identifier` and `variant_identifier` cannot both be set + --> $DIR/both.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/identifier/field_struct.rs b/test_suite/tests/ui/identifier/field_struct.rs similarity index 88% rename from test_suite/tests/compile-fail/identifier/field_struct.rs rename to test_suite/tests/ui/identifier/field_struct.rs index e6a8dc37..682c9db6 100644 --- a/test_suite/tests/compile-fail/identifier/field_struct.rs +++ b/test_suite/tests/ui/identifier/field_struct.rs @@ -11,7 +11,6 @@ extern crate serde_derive; #[derive(Deserialize)] #[serde(field_identifier)] -//~^^ ERROR: `field_identifier` can only be used on an enum struct S; fn main() {} diff --git a/test_suite/tests/ui/identifier/field_struct.stderr b/test_suite/tests/ui/identifier/field_struct.stderr new file mode 100644 index 00000000..c32659e7 --- /dev/null +++ b/test_suite/tests/ui/identifier/field_struct.stderr @@ -0,0 +1,8 @@ +error: `field_identifier` can only be used on an enum + --> $DIR/field_struct.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/identifier/field_tuple.rs b/test_suite/tests/ui/identifier/field_tuple.rs similarity index 87% rename from test_suite/tests/compile-fail/identifier/field_tuple.rs rename to test_suite/tests/ui/identifier/field_tuple.rs index e1dc5343..08a31785 100644 --- a/test_suite/tests/compile-fail/identifier/field_tuple.rs +++ b/test_suite/tests/ui/identifier/field_tuple.rs @@ -14,7 +14,6 @@ extern crate serde_derive; enum F { A, B(u8, u8), - //~^^^^^ ERROR: field_identifier may only contain unit variants } fn main() {} diff --git a/test_suite/tests/ui/identifier/field_tuple.stderr b/test_suite/tests/ui/identifier/field_tuple.stderr new file mode 100644 index 00000000..9899461c --- /dev/null +++ b/test_suite/tests/ui/identifier/field_tuple.stderr @@ -0,0 +1,8 @@ +error: field_identifier may only contain unit variants + --> $DIR/field_tuple.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/identifier/newtype_not_last.rs b/test_suite/tests/ui/identifier/newtype_not_last.rs similarity index 90% rename from test_suite/tests/compile-fail/identifier/newtype_not_last.rs rename to test_suite/tests/ui/identifier/newtype_not_last.rs index f9c1f470..6a94081a 100644 --- a/test_suite/tests/compile-fail/identifier/newtype_not_last.rs +++ b/test_suite/tests/ui/identifier/newtype_not_last.rs @@ -14,7 +14,6 @@ extern crate serde_derive; enum F { A, Other(String), - //~^^^^^ ERROR: `Other` must be the last variant B, } diff --git a/test_suite/tests/ui/identifier/newtype_not_last.stderr b/test_suite/tests/ui/identifier/newtype_not_last.stderr new file mode 100644 index 00000000..a873dad4 --- /dev/null +++ b/test_suite/tests/ui/identifier/newtype_not_last.stderr @@ -0,0 +1,8 @@ +error: `Other` must be the last variant + --> $DIR/newtype_not_last.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/identifier/not_unit.rs b/test_suite/tests/ui/identifier/not_unit.rs similarity index 88% rename from test_suite/tests/compile-fail/identifier/not_unit.rs rename to test_suite/tests/ui/identifier/not_unit.rs index a80d8bf2..31c8c3a1 100644 --- a/test_suite/tests/compile-fail/identifier/not_unit.rs +++ b/test_suite/tests/ui/identifier/not_unit.rs @@ -14,7 +14,6 @@ extern crate serde_derive; enum F { A, #[serde(other)] - //~^^^^^ ERROR: #[serde(other)] must be on a unit variant Other(u8, u8), } diff --git a/test_suite/tests/ui/identifier/not_unit.stderr b/test_suite/tests/ui/identifier/not_unit.stderr new file mode 100644 index 00000000..6cdddc8d --- /dev/null +++ b/test_suite/tests/ui/identifier/not_unit.stderr @@ -0,0 +1,8 @@ +error: #[serde(other)] must be on a unit variant + --> $DIR/not_unit.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/identifier/other_not_last.rs b/test_suite/tests/ui/identifier/other_not_last.rs similarity index 89% rename from test_suite/tests/compile-fail/identifier/other_not_last.rs rename to test_suite/tests/ui/identifier/other_not_last.rs index b8c81432..d18defb6 100644 --- a/test_suite/tests/compile-fail/identifier/other_not_last.rs +++ b/test_suite/tests/ui/identifier/other_not_last.rs @@ -14,7 +14,6 @@ extern crate serde_derive; enum F { A, #[serde(other)] - //~^^^^^ ERROR: #[serde(other)] must be the last variant Other, B, } diff --git a/test_suite/tests/ui/identifier/other_not_last.stderr b/test_suite/tests/ui/identifier/other_not_last.stderr new file mode 100644 index 00000000..3768f666 --- /dev/null +++ b/test_suite/tests/ui/identifier/other_not_last.stderr @@ -0,0 +1,8 @@ +error: #[serde(other)] must be the last variant + --> $DIR/other_not_last.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/identifier/serialize.rs b/test_suite/tests/ui/identifier/serialize.rs similarity index 89% rename from test_suite/tests/compile-fail/identifier/serialize.rs rename to test_suite/tests/ui/identifier/serialize.rs index 111f8875..cb27efbb 100644 --- a/test_suite/tests/compile-fail/identifier/serialize.rs +++ b/test_suite/tests/ui/identifier/serialize.rs @@ -11,7 +11,6 @@ extern crate serde_derive; #[derive(Serialize)] #[serde(field_identifier)] -//~^^ ERROR: field identifiers cannot be serialized enum F { A, B, diff --git a/test_suite/tests/ui/identifier/serialize.stderr b/test_suite/tests/ui/identifier/serialize.stderr new file mode 100644 index 00000000..9bdf463d --- /dev/null +++ b/test_suite/tests/ui/identifier/serialize.stderr @@ -0,0 +1,8 @@ +error: field identifiers cannot be serialized + --> $DIR/serialize.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/identifier/variant_struct.rs b/test_suite/tests/ui/identifier/variant_struct.rs similarity index 88% rename from test_suite/tests/compile-fail/identifier/variant_struct.rs rename to test_suite/tests/ui/identifier/variant_struct.rs index fdb7484f..6a8b4a01 100644 --- a/test_suite/tests/compile-fail/identifier/variant_struct.rs +++ b/test_suite/tests/ui/identifier/variant_struct.rs @@ -11,7 +11,6 @@ extern crate serde_derive; #[derive(Deserialize)] #[serde(variant_identifier)] -//~^^ ERROR: `variant_identifier` can only be used on an enum struct S; fn main() {} diff --git a/test_suite/tests/ui/identifier/variant_struct.stderr b/test_suite/tests/ui/identifier/variant_struct.stderr new file mode 100644 index 00000000..60d5cad1 --- /dev/null +++ b/test_suite/tests/ui/identifier/variant_struct.stderr @@ -0,0 +1,8 @@ +error: `variant_identifier` can only be used on an enum + --> $DIR/variant_struct.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/identifier/variant_tuple.rs b/test_suite/tests/ui/identifier/variant_tuple.rs similarity index 87% rename from test_suite/tests/compile-fail/identifier/variant_tuple.rs rename to test_suite/tests/ui/identifier/variant_tuple.rs index a5c708b2..513924f0 100644 --- a/test_suite/tests/compile-fail/identifier/variant_tuple.rs +++ b/test_suite/tests/ui/identifier/variant_tuple.rs @@ -14,7 +14,6 @@ extern crate serde_derive; enum F { A, B(u8, u8), - //~^^^^^ ERROR: variant_identifier may only contain unit variants } fn main() {} diff --git a/test_suite/tests/ui/identifier/variant_tuple.stderr b/test_suite/tests/ui/identifier/variant_tuple.stderr new file mode 100644 index 00000000..3dd44504 --- /dev/null +++ b/test_suite/tests/ui/identifier/variant_tuple.stderr @@ -0,0 +1,8 @@ +error: variant_identifier may only contain unit variants + --> $DIR/variant_tuple.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/precondition/deserialize_de_lifetime.rs b/test_suite/tests/ui/precondition/deserialize_de_lifetime.rs similarity index 84% rename from test_suite/tests/compile-fail/precondition/deserialize_de_lifetime.rs rename to test_suite/tests/ui/precondition/deserialize_de_lifetime.rs index 90d6aa6b..f14b1f77 100644 --- a/test_suite/tests/compile-fail/precondition/deserialize_de_lifetime.rs +++ b/test_suite/tests/ui/precondition/deserialize_de_lifetime.rs @@ -11,6 +11,5 @@ extern crate serde_derive; #[derive(Deserialize)] struct S<'de> { - //~^^ ERROR: cannot deserialize when there is a lifetime parameter called 'de s: &'de str, } diff --git a/test_suite/tests/ui/precondition/deserialize_de_lifetime.stderr b/test_suite/tests/ui/precondition/deserialize_de_lifetime.stderr new file mode 100644 index 00000000..27efc697 --- /dev/null +++ b/test_suite/tests/ui/precondition/deserialize_de_lifetime.stderr @@ -0,0 +1,8 @@ +error: cannot deserialize when there is a lifetime parameter called 'de + --> $DIR/deserialize_de_lifetime.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/precondition/deserialize_dst.rs b/test_suite/tests/ui/precondition/deserialize_dst.rs similarity index 87% rename from test_suite/tests/compile-fail/precondition/deserialize_dst.rs rename to test_suite/tests/ui/precondition/deserialize_dst.rs index 2ff159f1..aaf8948e 100644 --- a/test_suite/tests/compile-fail/precondition/deserialize_dst.rs +++ b/test_suite/tests/ui/precondition/deserialize_dst.rs @@ -13,5 +13,4 @@ extern crate serde_derive; struct S { string: String, slice: [u8], - //~^^^^ ERROR: cannot deserialize a dynamically sized struct } diff --git a/test_suite/tests/ui/precondition/deserialize_dst.stderr b/test_suite/tests/ui/precondition/deserialize_dst.stderr new file mode 100644 index 00000000..136fde1a --- /dev/null +++ b/test_suite/tests/ui/precondition/deserialize_dst.stderr @@ -0,0 +1,8 @@ +error: cannot deserialize a dynamically sized struct + --> $DIR/deserialize_dst.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/remote/bad_getter.rs b/test_suite/tests/ui/remote/bad_getter.rs similarity index 92% rename from test_suite/tests/compile-fail/remote/bad_getter.rs rename to test_suite/tests/ui/remote/bad_getter.rs index a20ebd74..136cccef 100644 --- a/test_suite/tests/compile-fail/remote/bad_getter.rs +++ b/test_suite/tests/ui/remote/bad_getter.rs @@ -19,7 +19,6 @@ mod remote { #[serde(remote = "remote::S")] struct S { #[serde(getter = "~~~")] - //~^^^^ ERROR: failed to parse path: "~~~" a: u8, } diff --git a/test_suite/tests/ui/remote/bad_getter.stderr b/test_suite/tests/ui/remote/bad_getter.stderr new file mode 100644 index 00000000..960310ad --- /dev/null +++ b/test_suite/tests/ui/remote/bad_getter.stderr @@ -0,0 +1,8 @@ +error: failed to parse path: "~~~" + --> $DIR/bad_getter.rs:18:10 + | +18 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/remote/bad_remote.rs b/test_suite/tests/ui/remote/bad_remote.rs similarity index 92% rename from test_suite/tests/compile-fail/remote/bad_remote.rs rename to test_suite/tests/ui/remote/bad_remote.rs index 62578a2d..f553d63c 100644 --- a/test_suite/tests/compile-fail/remote/bad_remote.rs +++ b/test_suite/tests/ui/remote/bad_remote.rs @@ -17,7 +17,6 @@ mod remote { #[derive(Serialize)] #[serde(remote = "~~~")] -//~^^ ERROR: failed to parse path: "~~~" struct S { a: u8, } diff --git a/test_suite/tests/ui/remote/bad_remote.stderr b/test_suite/tests/ui/remote/bad_remote.stderr new file mode 100644 index 00000000..e8d4f381 --- /dev/null +++ b/test_suite/tests/ui/remote/bad_remote.stderr @@ -0,0 +1,8 @@ +error: failed to parse path: "~~~" + --> $DIR/bad_remote.rs:18:10 + | +18 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/remote/enum_getter.rs b/test_suite/tests/ui/remote/enum_getter.rs similarity index 88% rename from test_suite/tests/compile-fail/remote/enum_getter.rs rename to test_suite/tests/ui/remote/enum_getter.rs index 7c258912..94254e85 100644 --- a/test_suite/tests/compile-fail/remote/enum_getter.rs +++ b/test_suite/tests/ui/remote/enum_getter.rs @@ -20,7 +20,6 @@ mod remote { pub enum E { A { #[serde(getter = "get_a")] - //~^^^^^ ERROR: #[serde(getter = "...")] is not allowed in an enum a: u8, }, } diff --git a/test_suite/tests/ui/remote/enum_getter.stderr b/test_suite/tests/ui/remote/enum_getter.stderr new file mode 100644 index 00000000..d25ed26f --- /dev/null +++ b/test_suite/tests/ui/remote/enum_getter.stderr @@ -0,0 +1,8 @@ +error: #[serde(getter = "...")] is not allowed in an enum + --> $DIR/enum_getter.rs:18:10 + | +18 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/remote/missing_field.rs b/test_suite/tests/ui/remote/missing_field.rs similarity index 89% rename from test_suite/tests/compile-fail/remote/missing_field.rs rename to test_suite/tests/ui/remote/missing_field.rs index ec1759a6..5485d9fe 100644 --- a/test_suite/tests/compile-fail/remote/missing_field.rs +++ b/test_suite/tests/ui/remote/missing_field.rs @@ -20,7 +20,6 @@ mod remote { #[serde(remote = "remote::S")] struct S { a: u8, - //~^^^ ERROR: missing field `b` in initializer of `remote::S` } fn main() {} diff --git a/test_suite/tests/ui/remote/missing_field.stderr b/test_suite/tests/ui/remote/missing_field.stderr new file mode 100644 index 00000000..b3ada181 --- /dev/null +++ b/test_suite/tests/ui/remote/missing_field.stderr @@ -0,0 +1,9 @@ +error[E0063]: missing field `b` in initializer of `remote::S` + --> $DIR/missing_field.rs:20:18 + | +20 | #[serde(remote = "remote::S")] + | ^^^^^^^^^^^ missing `b` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0063`. diff --git a/test_suite/tests/compile-fail/remote/nonremote_getter.rs b/test_suite/tests/ui/remote/nonremote_getter.rs similarity index 83% rename from test_suite/tests/compile-fail/remote/nonremote_getter.rs rename to test_suite/tests/ui/remote/nonremote_getter.rs index 541e7986..05784478 100644 --- a/test_suite/tests/compile-fail/remote/nonremote_getter.rs +++ b/test_suite/tests/ui/remote/nonremote_getter.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Serialize)] struct S { #[serde(getter = "S::get")] - //~^^^ ERROR: #[serde(getter = "...")] can only be used in structs that have #[serde(remote = "...")] a: u8, } diff --git a/test_suite/tests/ui/remote/nonremote_getter.stderr b/test_suite/tests/ui/remote/nonremote_getter.stderr new file mode 100644 index 00000000..3a121573 --- /dev/null +++ b/test_suite/tests/ui/remote/nonremote_getter.stderr @@ -0,0 +1,8 @@ +error: #[serde(getter = "...")] can only be used in structs that have #[serde(remote = "...")] + --> $DIR/nonremote_getter.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/remote/unknown_field.rs b/test_suite/tests/ui/remote/unknown_field.rs similarity index 83% rename from test_suite/tests/compile-fail/remote/unknown_field.rs rename to test_suite/tests/ui/remote/unknown_field.rs index 7bcb8258..ad5f01f1 100644 --- a/test_suite/tests/compile-fail/remote/unknown_field.rs +++ b/test_suite/tests/ui/remote/unknown_field.rs @@ -19,8 +19,6 @@ mod remote { #[serde(remote = "remote::S")] struct S { b: u8, - //~^ ERROR: struct `remote::S` has no field named `b` - //~^^ ERROR: no field `b` on type `&remote::S` } fn main() {} diff --git a/test_suite/tests/ui/remote/unknown_field.stderr b/test_suite/tests/ui/remote/unknown_field.stderr new file mode 100644 index 00000000..d401cfb6 --- /dev/null +++ b/test_suite/tests/ui/remote/unknown_field.stderr @@ -0,0 +1,16 @@ +error[E0609]: no field `b` on type `&remote::S` + --> $DIR/unknown_field.rs:21:5 + | +21 | b: u8, + | ^ + +error[E0560]: struct `remote::S` has no field named `b` + --> $DIR/unknown_field.rs:21:5 + | +21 | b: u8, + | ^ field does not exist - did you mean `a`? + +error: aborting due to 2 previous errors + +Some errors occurred: E0560, E0609. +For more information about an error, try `rustc --explain E0560`. diff --git a/test_suite/tests/compile-fail/remote/wrong_de.rs b/test_suite/tests/ui/remote/wrong_de.rs similarity index 89% rename from test_suite/tests/compile-fail/remote/wrong_de.rs rename to test_suite/tests/ui/remote/wrong_de.rs index c154d932..1a3e4e43 100644 --- a/test_suite/tests/compile-fail/remote/wrong_de.rs +++ b/test_suite/tests/ui/remote/wrong_de.rs @@ -16,7 +16,5 @@ mod remote { #[derive(Deserialize)] #[serde(remote = "remote::S")] struct S(u8); -//~^^^ ERROR: mismatched types -//~^^^^ expected u16, found u8 fn main() {} diff --git a/test_suite/tests/ui/remote/wrong_de.stderr b/test_suite/tests/ui/remote/wrong_de.stderr new file mode 100644 index 00000000..7b3dfc90 --- /dev/null +++ b/test_suite/tests/ui/remote/wrong_de.stderr @@ -0,0 +1,13 @@ +error[E0308]: mismatched types + --> $DIR/wrong_de.rs:16:10 + | +16 | #[derive(Deserialize)] + | ^^^^^^^^^^^ expected u16, found u8 +help: you can cast an `u8` to `u16`, which will zero-extend the source value + | +16 | #[derive(Deserialize.into())] + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/test_suite/tests/compile-fail/remote/wrong_getter.rs b/test_suite/tests/ui/remote/wrong_getter.rs similarity index 90% rename from test_suite/tests/compile-fail/remote/wrong_getter.rs rename to test_suite/tests/ui/remote/wrong_getter.rs index 51107687..0cb5e0f5 100644 --- a/test_suite/tests/compile-fail/remote/wrong_getter.rs +++ b/test_suite/tests/ui/remote/wrong_getter.rs @@ -25,9 +25,7 @@ mod remote { #[serde(remote = "remote::S")] struct S { #[serde(getter = "remote::S::get")] - //~^^^^ ERROR: mismatched types a: u8, - //~^^^^^^ expected u8, found u16 } fn main() {} diff --git a/test_suite/tests/ui/remote/wrong_getter.stderr b/test_suite/tests/ui/remote/wrong_getter.stderr new file mode 100644 index 00000000..d52b58f9 --- /dev/null +++ b/test_suite/tests/ui/remote/wrong_getter.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/wrong_getter.rs:24:10 + | +24 | #[derive(Serialize)] + | ^^^^^^^^^ expected u8, found u16 + | + = note: expected type `&u8` + found type `&u16` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/test_suite/tests/compile-fail/remote/wrong_ser.rs b/test_suite/tests/ui/remote/wrong_ser.rs similarity index 88% rename from test_suite/tests/compile-fail/remote/wrong_ser.rs rename to test_suite/tests/ui/remote/wrong_ser.rs index 22513da7..1ce1815f 100644 --- a/test_suite/tests/compile-fail/remote/wrong_ser.rs +++ b/test_suite/tests/ui/remote/wrong_ser.rs @@ -19,8 +19,6 @@ mod remote { #[serde(remote = "remote::S")] struct S { a: u8, - //~^^^^ ERROR: mismatched types - //~^^^^^ expected u8, found u16 } fn main() {} diff --git a/test_suite/tests/ui/remote/wrong_ser.stderr b/test_suite/tests/ui/remote/wrong_ser.stderr new file mode 100644 index 00000000..8dc4de0c --- /dev/null +++ b/test_suite/tests/ui/remote/wrong_ser.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/wrong_ser.rs:18:10 + | +18 | #[derive(Serialize)] + | ^^^^^^^^^ expected u8, found u16 + | + = note: expected type `&u8` + found type `&u16` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/test_suite/tests/compile-fail/transparent/at_most_one.rs b/test_suite/tests/ui/transparent/at_most_one.rs similarity index 84% rename from test_suite/tests/compile-fail/transparent/at_most_one.rs rename to test_suite/tests/ui/transparent/at_most_one.rs index 0ec4e083..728c6351 100644 --- a/test_suite/tests/compile-fail/transparent/at_most_one.rs +++ b/test_suite/tests/ui/transparent/at_most_one.rs @@ -11,7 +11,6 @@ extern crate serde_derive; #[derive(Serialize)] #[serde(transparent)] -//~^^ ERROR: #[serde(transparent)] requires struct to have at most one transparent field struct S { a: u8, b: u8, diff --git a/test_suite/tests/ui/transparent/at_most_one.stderr b/test_suite/tests/ui/transparent/at_most_one.stderr new file mode 100644 index 00000000..cbb98e6c --- /dev/null +++ b/test_suite/tests/ui/transparent/at_most_one.stderr @@ -0,0 +1,8 @@ +error: #[serde(transparent)] requires struct to have at most one transparent field + --> $DIR/at_most_one.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/transparent/de_at_least_one.rs b/test_suite/tests/ui/transparent/de_at_least_one.rs similarity index 83% rename from test_suite/tests/compile-fail/transparent/de_at_least_one.rs rename to test_suite/tests/ui/transparent/de_at_least_one.rs index a911e0cb..9e6921a1 100644 --- a/test_suite/tests/compile-fail/transparent/de_at_least_one.rs +++ b/test_suite/tests/ui/transparent/de_at_least_one.rs @@ -11,7 +11,6 @@ extern crate serde_derive; #[derive(Deserialize)] #[serde(transparent)] -//~^^ ERROR: #[serde(transparent)] requires at least one field that is neither skipped nor has a default struct S { #[serde(skip)] a: u8, diff --git a/test_suite/tests/ui/transparent/de_at_least_one.stderr b/test_suite/tests/ui/transparent/de_at_least_one.stderr new file mode 100644 index 00000000..8e663c22 --- /dev/null +++ b/test_suite/tests/ui/transparent/de_at_least_one.stderr @@ -0,0 +1,8 @@ +error: #[serde(transparent)] requires at least one field that is neither skipped nor has a default + --> $DIR/de_at_least_one.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/transparent/ser_at_least_one.rs b/test_suite/tests/ui/transparent/ser_at_least_one.rs similarity index 85% rename from test_suite/tests/compile-fail/transparent/ser_at_least_one.rs rename to test_suite/tests/ui/transparent/ser_at_least_one.rs index ae392e8e..aaf5d0bc 100644 --- a/test_suite/tests/compile-fail/transparent/ser_at_least_one.rs +++ b/test_suite/tests/ui/transparent/ser_at_least_one.rs @@ -11,7 +11,6 @@ extern crate serde_derive; #[derive(Serialize)] #[serde(transparent)] -//~^^ ERROR: #[serde(transparent)] requires at least one field that is not skipped struct S { #[serde(skip)] a: u8, diff --git a/test_suite/tests/ui/transparent/ser_at_least_one.stderr b/test_suite/tests/ui/transparent/ser_at_least_one.stderr new file mode 100644 index 00000000..3f3d2417 --- /dev/null +++ b/test_suite/tests/ui/transparent/ser_at_least_one.stderr @@ -0,0 +1,8 @@ +error: #[serde(transparent)] requires at least one field that is not skipped + --> $DIR/ser_at_least_one.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/type-attribute/from.rs b/test_suite/tests/ui/type-attribute/from.rs similarity index 90% rename from test_suite/tests/compile-fail/type-attribute/from.rs rename to test_suite/tests/ui/type-attribute/from.rs index ce51c436..6d585a7c 100644 --- a/test_suite/tests/compile-fail/type-attribute/from.rs +++ b/test_suite/tests/ui/type-attribute/from.rs @@ -11,7 +11,6 @@ extern crate serde_derive; #[derive(Deserialize)] #[serde(from = "Option $DIR/from.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/type-attribute/into.rs b/test_suite/tests/ui/type-attribute/into.rs similarity index 90% rename from test_suite/tests/compile-fail/type-attribute/into.rs rename to test_suite/tests/ui/type-attribute/into.rs index 9fe72733..faba3aae 100644 --- a/test_suite/tests/compile-fail/type-attribute/into.rs +++ b/test_suite/tests/ui/type-attribute/into.rs @@ -11,7 +11,6 @@ extern crate serde_derive; #[derive(Serialize)] #[serde(into = "Option $DIR/into.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/unknown-attribute/container.rs b/test_suite/tests/ui/unknown-attribute/container.rs similarity index 89% rename from test_suite/tests/compile-fail/unknown-attribute/container.rs rename to test_suite/tests/ui/unknown-attribute/container.rs index c4a804d2..69ef2f60 100644 --- a/test_suite/tests/compile-fail/unknown-attribute/container.rs +++ b/test_suite/tests/ui/unknown-attribute/container.rs @@ -11,7 +11,6 @@ extern crate serde_derive; #[derive(Serialize)] #[serde(abc = "xyz")] -//~^^ ERROR: unknown serde container attribute `abc` struct A { x: u32, } diff --git a/test_suite/tests/ui/unknown-attribute/container.stderr b/test_suite/tests/ui/unknown-attribute/container.stderr new file mode 100644 index 00000000..6b026c6e --- /dev/null +++ b/test_suite/tests/ui/unknown-attribute/container.stderr @@ -0,0 +1,8 @@ +error: unknown serde container attribute `abc` + --> $DIR/container.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/unknown-attribute/field.rs b/test_suite/tests/ui/unknown-attribute/field.rs similarity index 89% rename from test_suite/tests/compile-fail/unknown-attribute/field.rs rename to test_suite/tests/ui/unknown-attribute/field.rs index fad814d5..ea8c0bb9 100644 --- a/test_suite/tests/compile-fail/unknown-attribute/field.rs +++ b/test_suite/tests/ui/unknown-attribute/field.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Serialize)] struct C { #[serde(abc = "xyz")] - //~^^^ ERROR: unknown serde field attribute `abc` x: u32, } diff --git a/test_suite/tests/ui/unknown-attribute/field.stderr b/test_suite/tests/ui/unknown-attribute/field.stderr new file mode 100644 index 00000000..36cdd6c6 --- /dev/null +++ b/test_suite/tests/ui/unknown-attribute/field.stderr @@ -0,0 +1,8 @@ +error: unknown serde field attribute `abc` + --> $DIR/field.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/unknown-attribute/variant.rs b/test_suite/tests/ui/unknown-attribute/variant.rs similarity index 89% rename from test_suite/tests/compile-fail/unknown-attribute/variant.rs rename to test_suite/tests/ui/unknown-attribute/variant.rs index 45e9487d..eb966984 100644 --- a/test_suite/tests/compile-fail/unknown-attribute/variant.rs +++ b/test_suite/tests/ui/unknown-attribute/variant.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Serialize)] enum E { #[serde(abc = "xyz")] - //~^^^ ERROR: unknown serde variant attribute `abc` V, } diff --git a/test_suite/tests/ui/unknown-attribute/variant.stderr b/test_suite/tests/ui/unknown-attribute/variant.stderr new file mode 100644 index 00000000..fd74fd0f --- /dev/null +++ b/test_suite/tests/ui/unknown-attribute/variant.stderr @@ -0,0 +1,8 @@ +error: unknown serde variant attribute `abc` + --> $DIR/variant.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/ui/update-references.sh b/test_suite/tests/ui/update-references.sh new file mode 100755 index 00000000..aa99d35f --- /dev/null +++ b/test_suite/tests/ui/update-references.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# +# Copyright 2015 The Rust Project Developers. See the COPYRIGHT +# file at the top-level directory of this distribution and at +# http://rust-lang.org/COPYRIGHT. +# +# 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. + +# A script to update the references for particular tests. The idea is +# that you do a run, which will generate files in the build directory +# containing the (normalized) actual output of the compiler. This +# script will then copy that output and replace the "expected output" +# files. You can then commit the changes. +# +# If you find yourself manually editing a foo.stderr file, you're +# doing it wrong. + +if [[ "$1" == "--help" || "$1" == "-h" || "$1" == "" || "$2" == "" ]]; then + echo "usage: $0 " + echo "" + echo "For example:" + echo " $0 ../../../build/x86_64-apple-darwin/test/ui *.rs */*.rs" +fi + +MYDIR=$(dirname $0) + +BUILD_DIR="$1" +shift + +while [[ "$1" != "" ]]; do + STDERR_NAME="${1/%.rs/.stderr}" + STDOUT_NAME="${1/%.rs/.stdout}" + shift + if [ -f $BUILD_DIR/$STDOUT_NAME ] && \ + ! (diff $BUILD_DIR/$STDOUT_NAME $MYDIR/$STDOUT_NAME >& /dev/null); then + echo updating $MYDIR/$STDOUT_NAME + cp $BUILD_DIR/$STDOUT_NAME $MYDIR/$STDOUT_NAME + fi + if [ -f $BUILD_DIR/$STDERR_NAME ] && \ + ! (diff $BUILD_DIR/$STDERR_NAME $MYDIR/$STDERR_NAME >& /dev/null); then + echo updating $MYDIR/$STDERR_NAME + cp $BUILD_DIR/$STDERR_NAME $MYDIR/$STDERR_NAME + fi +done + + diff --git a/test_suite/tests/compile-fail/with-variant/skip_de_newtype_field.rs b/test_suite/tests/ui/with-variant/skip_de_newtype_field.rs similarity index 80% rename from test_suite/tests/compile-fail/with-variant/skip_de_newtype_field.rs rename to test_suite/tests/ui/with-variant/skip_de_newtype_field.rs index db67c425..faa3c76d 100644 --- a/test_suite/tests/compile-fail/with-variant/skip_de_newtype_field.rs +++ b/test_suite/tests/ui/with-variant/skip_de_newtype_field.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Deserialize)] enum Enum { #[serde(deserialize_with = "deserialize_some_newtype_variant")] - //~^^^ ERROR: variant `Newtype` cannot have both #[serde(deserialize_with)] and a field 0 marked with #[serde(skip_deserializing)] Newtype(#[serde(skip_deserializing)] String), } diff --git a/test_suite/tests/ui/with-variant/skip_de_newtype_field.stderr b/test_suite/tests/ui/with-variant/skip_de_newtype_field.stderr new file mode 100644 index 00000000..29288e48 --- /dev/null +++ b/test_suite/tests/ui/with-variant/skip_de_newtype_field.stderr @@ -0,0 +1,8 @@ +error: variant `Newtype` cannot have both #[serde(deserialize_with)] and a field 0 marked with #[serde(skip_deserializing)] + --> $DIR/skip_de_newtype_field.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/with-variant/skip_de_struct_field.rs b/test_suite/tests/ui/with-variant/skip_de_struct_field.rs similarity index 81% rename from test_suite/tests/compile-fail/with-variant/skip_de_struct_field.rs rename to test_suite/tests/ui/with-variant/skip_de_struct_field.rs index 29ba2205..fa0abc9d 100644 --- a/test_suite/tests/compile-fail/with-variant/skip_de_struct_field.rs +++ b/test_suite/tests/ui/with-variant/skip_de_struct_field.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Deserialize)] enum Enum { #[serde(deserialize_with = "deserialize_some_other_variant")] - //~^^^ ERROR: variant `Struct` cannot have both #[serde(deserialize_with)] and a field `f1` marked with #[serde(skip_deserializing)] Struct { #[serde(skip_deserializing)] f1: String, diff --git a/test_suite/tests/ui/with-variant/skip_de_struct_field.stderr b/test_suite/tests/ui/with-variant/skip_de_struct_field.stderr new file mode 100644 index 00000000..db405127 --- /dev/null +++ b/test_suite/tests/ui/with-variant/skip_de_struct_field.stderr @@ -0,0 +1,8 @@ +error: variant `Struct` cannot have both #[serde(deserialize_with)] and a field `f1` marked with #[serde(skip_deserializing)] + --> $DIR/skip_de_struct_field.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/with-variant/skip_de_tuple_field.rs b/test_suite/tests/ui/with-variant/skip_de_tuple_field.rs similarity index 80% rename from test_suite/tests/compile-fail/with-variant/skip_de_tuple_field.rs rename to test_suite/tests/ui/with-variant/skip_de_tuple_field.rs index a0e9083c..3889b49d 100644 --- a/test_suite/tests/compile-fail/with-variant/skip_de_tuple_field.rs +++ b/test_suite/tests/ui/with-variant/skip_de_tuple_field.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Deserialize)] enum Enum { #[serde(deserialize_with = "deserialize_some_other_variant")] - //~^^^ ERROR: variant `Tuple` cannot have both #[serde(deserialize_with)] and a field 0 marked with #[serde(skip_deserializing)] Tuple(#[serde(skip_deserializing)] String, u8), } diff --git a/test_suite/tests/ui/with-variant/skip_de_tuple_field.stderr b/test_suite/tests/ui/with-variant/skip_de_tuple_field.stderr new file mode 100644 index 00000000..07cb2a9e --- /dev/null +++ b/test_suite/tests/ui/with-variant/skip_de_tuple_field.stderr @@ -0,0 +1,8 @@ +error: variant `Tuple` cannot have both #[serde(deserialize_with)] and a field 0 marked with #[serde(skip_deserializing)] + --> $DIR/skip_de_tuple_field.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/with-variant/skip_de_whole_variant.rs b/test_suite/tests/ui/with-variant/skip_de_whole_variant.rs similarity index 82% rename from test_suite/tests/compile-fail/with-variant/skip_de_whole_variant.rs rename to test_suite/tests/ui/with-variant/skip_de_whole_variant.rs index ea1307c7..523cfbc2 100644 --- a/test_suite/tests/compile-fail/with-variant/skip_de_whole_variant.rs +++ b/test_suite/tests/ui/with-variant/skip_de_whole_variant.rs @@ -13,7 +13,6 @@ extern crate serde_derive; enum Enum { #[serde(deserialize_with = "deserialize_some_unit_variant")] #[serde(skip_deserializing)] - //~^^^^ ERROR: variant `Unit` cannot have both #[serde(deserialize_with)] and #[serde(skip_deserializing)] Unit, } diff --git a/test_suite/tests/ui/with-variant/skip_de_whole_variant.stderr b/test_suite/tests/ui/with-variant/skip_de_whole_variant.stderr new file mode 100644 index 00000000..718907d1 --- /dev/null +++ b/test_suite/tests/ui/with-variant/skip_de_whole_variant.stderr @@ -0,0 +1,8 @@ +error: variant `Unit` cannot have both #[serde(deserialize_with)] and #[serde(skip_deserializing)] + --> $DIR/skip_de_whole_variant.rs:12:10 + | +12 | #[derive(Deserialize)] + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/with-variant/skip_ser_newtype_field.rs b/test_suite/tests/ui/with-variant/skip_ser_newtype_field.rs similarity index 80% rename from test_suite/tests/compile-fail/with-variant/skip_ser_newtype_field.rs rename to test_suite/tests/ui/with-variant/skip_ser_newtype_field.rs index c5417f89..60181b5e 100644 --- a/test_suite/tests/compile-fail/with-variant/skip_ser_newtype_field.rs +++ b/test_suite/tests/ui/with-variant/skip_ser_newtype_field.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Serialize)] enum Enum { #[serde(serialize_with = "serialize_some_newtype_variant")] - //~^^^ ERROR: variant `Newtype` cannot have both #[serde(serialize_with)] and a field 0 marked with #[serde(skip_serializing)] Newtype(#[serde(skip_serializing)] String), } diff --git a/test_suite/tests/ui/with-variant/skip_ser_newtype_field.stderr b/test_suite/tests/ui/with-variant/skip_ser_newtype_field.stderr new file mode 100644 index 00000000..8dbed4a4 --- /dev/null +++ b/test_suite/tests/ui/with-variant/skip_ser_newtype_field.stderr @@ -0,0 +1,8 @@ +error: variant `Newtype` cannot have both #[serde(serialize_with)] and a field 0 marked with #[serde(skip_serializing)] + --> $DIR/skip_ser_newtype_field.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/with-variant/skip_ser_newtype_field_if.rs b/test_suite/tests/ui/with-variant/skip_ser_newtype_field_if.rs similarity index 80% rename from test_suite/tests/compile-fail/with-variant/skip_ser_newtype_field_if.rs rename to test_suite/tests/ui/with-variant/skip_ser_newtype_field_if.rs index 98325692..b53ac2b3 100644 --- a/test_suite/tests/compile-fail/with-variant/skip_ser_newtype_field_if.rs +++ b/test_suite/tests/ui/with-variant/skip_ser_newtype_field_if.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Serialize)] enum Enum { #[serde(serialize_with = "serialize_some_newtype_variant")] - //~^^^ ERROR: variant `Newtype` cannot have both #[serde(serialize_with)] and a field 0 marked with #[serde(skip_serializing_if)] Newtype(#[serde(skip_serializing_if = "always")] String), } diff --git a/test_suite/tests/ui/with-variant/skip_ser_newtype_field_if.stderr b/test_suite/tests/ui/with-variant/skip_ser_newtype_field_if.stderr new file mode 100644 index 00000000..64e76051 --- /dev/null +++ b/test_suite/tests/ui/with-variant/skip_ser_newtype_field_if.stderr @@ -0,0 +1,8 @@ +error: variant `Newtype` cannot have both #[serde(serialize_with)] and a field 0 marked with #[serde(skip_serializing_if)] + --> $DIR/skip_ser_newtype_field_if.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/with-variant/skip_ser_struct_field.rs b/test_suite/tests/ui/with-variant/skip_ser_struct_field.rs similarity index 81% rename from test_suite/tests/compile-fail/with-variant/skip_ser_struct_field.rs rename to test_suite/tests/ui/with-variant/skip_ser_struct_field.rs index 0194e959..75d141a8 100644 --- a/test_suite/tests/compile-fail/with-variant/skip_ser_struct_field.rs +++ b/test_suite/tests/ui/with-variant/skip_ser_struct_field.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Serialize)] enum Enum { #[serde(serialize_with = "serialize_some_other_variant")] - //~^^^ ERROR: variant `Struct` cannot have both #[serde(serialize_with)] and a field `f1` marked with #[serde(skip_serializing)] Struct { #[serde(skip_serializing)] f1: String, diff --git a/test_suite/tests/ui/with-variant/skip_ser_struct_field.stderr b/test_suite/tests/ui/with-variant/skip_ser_struct_field.stderr new file mode 100644 index 00000000..e80bd35f --- /dev/null +++ b/test_suite/tests/ui/with-variant/skip_ser_struct_field.stderr @@ -0,0 +1,8 @@ +error: variant `Struct` cannot have both #[serde(serialize_with)] and a field `f1` marked with #[serde(skip_serializing)] + --> $DIR/skip_ser_struct_field.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/with-variant/skip_ser_struct_field_if.rs b/test_suite/tests/ui/with-variant/skip_ser_struct_field_if.rs similarity index 81% rename from test_suite/tests/compile-fail/with-variant/skip_ser_struct_field_if.rs rename to test_suite/tests/ui/with-variant/skip_ser_struct_field_if.rs index 5f871178..42c319d9 100644 --- a/test_suite/tests/compile-fail/with-variant/skip_ser_struct_field_if.rs +++ b/test_suite/tests/ui/with-variant/skip_ser_struct_field_if.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Serialize)] enum Enum { #[serde(serialize_with = "serialize_some_newtype_variant")] - //~^^^ ERROR: variant `Struct` cannot have both #[serde(serialize_with)] and a field `f1` marked with #[serde(skip_serializing_if)] Struct { #[serde(skip_serializing_if = "always")] f1: String, diff --git a/test_suite/tests/ui/with-variant/skip_ser_struct_field_if.stderr b/test_suite/tests/ui/with-variant/skip_ser_struct_field_if.stderr new file mode 100644 index 00000000..52dd82a7 --- /dev/null +++ b/test_suite/tests/ui/with-variant/skip_ser_struct_field_if.stderr @@ -0,0 +1,8 @@ +error: variant `Struct` cannot have both #[serde(serialize_with)] and a field `f1` marked with #[serde(skip_serializing_if)] + --> $DIR/skip_ser_struct_field_if.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/with-variant/skip_ser_tuple_field.rs b/test_suite/tests/ui/with-variant/skip_ser_tuple_field.rs similarity index 80% rename from test_suite/tests/compile-fail/with-variant/skip_ser_tuple_field.rs rename to test_suite/tests/ui/with-variant/skip_ser_tuple_field.rs index 682a8330..97b931b9 100644 --- a/test_suite/tests/compile-fail/with-variant/skip_ser_tuple_field.rs +++ b/test_suite/tests/ui/with-variant/skip_ser_tuple_field.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Serialize)] enum Enum { #[serde(serialize_with = "serialize_some_other_variant")] - //~^^^ ERROR: variant `Tuple` cannot have both #[serde(serialize_with)] and a field 0 marked with #[serde(skip_serializing)] Tuple(#[serde(skip_serializing)] String, u8), } diff --git a/test_suite/tests/ui/with-variant/skip_ser_tuple_field.stderr b/test_suite/tests/ui/with-variant/skip_ser_tuple_field.stderr new file mode 100644 index 00000000..9e83c13a --- /dev/null +++ b/test_suite/tests/ui/with-variant/skip_ser_tuple_field.stderr @@ -0,0 +1,8 @@ +error: variant `Tuple` cannot have both #[serde(serialize_with)] and a field 0 marked with #[serde(skip_serializing)] + --> $DIR/skip_ser_tuple_field.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/with-variant/skip_ser_tuple_field_if.rs b/test_suite/tests/ui/with-variant/skip_ser_tuple_field_if.rs similarity index 80% rename from test_suite/tests/compile-fail/with-variant/skip_ser_tuple_field_if.rs rename to test_suite/tests/ui/with-variant/skip_ser_tuple_field_if.rs index c27e25b6..ec771ca9 100644 --- a/test_suite/tests/compile-fail/with-variant/skip_ser_tuple_field_if.rs +++ b/test_suite/tests/ui/with-variant/skip_ser_tuple_field_if.rs @@ -12,7 +12,6 @@ extern crate serde_derive; #[derive(Serialize)] enum Enum { #[serde(serialize_with = "serialize_some_other_variant")] - //~^^^ ERROR: variant `Tuple` cannot have both #[serde(serialize_with)] and a field 0 marked with #[serde(skip_serializing_if)] Tuple(#[serde(skip_serializing_if = "always")] String, u8), } diff --git a/test_suite/tests/ui/with-variant/skip_ser_tuple_field_if.stderr b/test_suite/tests/ui/with-variant/skip_ser_tuple_field_if.stderr new file mode 100644 index 00000000..dd777ff1 --- /dev/null +++ b/test_suite/tests/ui/with-variant/skip_ser_tuple_field_if.stderr @@ -0,0 +1,8 @@ +error: variant `Tuple` cannot have both #[serde(serialize_with)] and a field 0 marked with #[serde(skip_serializing_if)] + --> $DIR/skip_ser_tuple_field_if.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/test_suite/tests/compile-fail/with-variant/skip_ser_whole_variant.rs b/test_suite/tests/ui/with-variant/skip_ser_whole_variant.rs similarity index 83% rename from test_suite/tests/compile-fail/with-variant/skip_ser_whole_variant.rs rename to test_suite/tests/ui/with-variant/skip_ser_whole_variant.rs index 1e23e0ab..c667d81f 100644 --- a/test_suite/tests/compile-fail/with-variant/skip_ser_whole_variant.rs +++ b/test_suite/tests/ui/with-variant/skip_ser_whole_variant.rs @@ -13,7 +13,6 @@ extern crate serde_derive; enum Enum { #[serde(serialize_with = "serialize_some_unit_variant")] #[serde(skip_serializing)] - //~^^^^ ERROR: variant `Unit` cannot have both #[serde(serialize_with)] and #[serde(skip_serializing)] Unit, } diff --git a/test_suite/tests/ui/with-variant/skip_ser_whole_variant.stderr b/test_suite/tests/ui/with-variant/skip_ser_whole_variant.stderr new file mode 100644 index 00000000..82f8dddd --- /dev/null +++ b/test_suite/tests/ui/with-variant/skip_ser_whole_variant.stderr @@ -0,0 +1,8 @@ +error: variant `Unit` cannot have both #[serde(serialize_with)] and #[serde(skip_serializing)] + --> $DIR/skip_ser_whole_variant.rs:12:10 + | +12 | #[derive(Serialize)] + | ^^^^^^^^^ + +error: aborting due to previous error +