Improve UI test coverage

With this commit I believe I've covered all `compile_error!`-based
errors.
This commit is contained in:
hcpl
2018-11-30 03:07:31 +02:00
parent 034db9f20f
commit 14a3da9b16
56 changed files with 529 additions and 1 deletions
@@ -0,0 +1,11 @@
#[macro_use]
extern crate serde_derive;
#[derive(Deserialize)]
#[serde(untagged)]
enum F {
#[serde(other)]
Other,
}
fn main() {}
@@ -0,0 +1,9 @@
error: #[serde(other)] cannot appear on untagged enum
--> $DIR/other_untagged.rs:7:5
|
7 | / #[serde(other)]
8 | | Other,
| |_________^
error: aborting due to previous error
@@ -0,0 +1,11 @@
#[macro_use]
extern crate serde_derive;
#[derive(Deserialize)]
#[serde(variant_identifier)]
enum F {
#[serde(other)]
Other,
}
fn main() {}
@@ -0,0 +1,9 @@
error: #[serde(other)] may not be used on a variant identifier
--> $DIR/other_variant.rs:7:5
|
7 | / #[serde(other)]
8 | | Other,
| |_________^
error: aborting due to previous error
@@ -1,11 +0,0 @@
#[macro_use]
extern crate serde_derive;
#[derive(Serialize)]
#[serde(field_identifier)]
enum F {
A,
B,
}
fn main() {}
@@ -1,12 +0,0 @@
error: field identifiers cannot be serialized
--> $DIR/serialize.rs:5:1
|
5 | / #[serde(field_identifier)]
6 | | enum F {
7 | | A,
8 | | B,
9 | | }
| |_^
error: aborting due to previous error