Improve overall quality of compile_error! errors

Also updates UI tests.
This commit is contained in:
hcpl
2018-11-29 08:01:17 +02:00
parent 8f3f073017
commit 034db9f20f
69 changed files with 714 additions and 429 deletions
@@ -1,8 +1,8 @@
error: failed to parse borrowed lifetimes: "zzz"
--> $DIR/bad_lifetimes.rs:4:10
--> $DIR/bad_lifetimes.rs:6:22
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
6 | #[serde(borrow = "zzz")]
| ^^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: duplicate borrowed lifetime `'a`
--> $DIR/duplicate_lifetime.rs:4:10
--> $DIR/duplicate_lifetime.rs:6:22
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
6 | #[serde(borrow = "'a + 'a")]
| ^^^^^^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: duplicate serde attribute `borrow`
--> $DIR/duplicate_variant.rs:7:10
--> $DIR/duplicate_variant.rs:9:13
|
7 | #[derive(Deserialize)]
| ^^^^^^^^^^^
9 | #[serde(borrow)]
| ^^^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: at least one lifetime must be borrowed
--> $DIR/empty_lifetimes.rs:4:10
--> $DIR/empty_lifetimes.rs:6:22
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
6 | #[serde(borrow = "")]
| ^^
error: aborting due to previous error
@@ -1,8 +1,9 @@
error: field `s` has no lifetimes to borrow
--> $DIR/no_lifetimes.rs:4:10
--> $DIR/no_lifetimes.rs:6:5
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
6 | / #[serde(borrow)]
7 | | s: String,
| |_____________^
error: aborting due to previous error
@@ -1,8 +1,9 @@
error: #[serde(borrow)] may only be used on newtype variants
--> $DIR/struct_variant.rs:7:10
|
7 | #[derive(Deserialize)]
| ^^^^^^^^^^^
--> $DIR/struct_variant.rs:9:5
|
9 | / #[serde(borrow)]
10 | | S { s: Str<'a> },
| |____________________^
error: aborting due to previous error
@@ -1,8 +1,9 @@
error: field `s` does not have lifetime 'b
--> $DIR/wrong_lifetime.rs:4:10
--> $DIR/wrong_lifetime.rs:6:5
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
6 | / #[serde(borrow = "'b")]
7 | | s: &'a str,
| |______________^
error: aborting due to previous error
@@ -1,8 +1,12 @@
error: enum tags `conflict` for type and content conflict with each other
--> $DIR/adjacent-tag.rs:4:10
--> $DIR/adjacent-tag.rs:5:1
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
5 | / #[serde(tag = "conflict", content = "conflict")]
6 | | enum E {
7 | | A,
8 | | B,
9 | | }
| |_^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: #[serde(flatten)] cannot be used on newtype structs
--> $DIR/flatten-newtype-struct.rs:4:10
--> $DIR/flatten-newtype-struct.rs:5:12
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
5 | struct Foo(#[serde(flatten)] HashMap<String, String>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
@@ -1,8 +1,9 @@
error: #[serde(flatten] can not be combined with #[serde(skip_deserializing)]
--> $DIR/flatten-skip-deserializing.rs:4:10
error: #[serde(flatten)] can not be combined with #[serde(skip_deserializing)]
--> $DIR/flatten-skip-deserializing.rs:6:5
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
6 | / #[serde(flatten, skip_deserializing)]
7 | | other: Other,
| |________________^
error: aborting due to previous error
@@ -1,8 +1,9 @@
error: #[serde(flatten] can not be combined with #[serde(skip_serializing_if = "...")]
--> $DIR/flatten-skip-serializing-if.rs:4:10
error: #[serde(flatten)] can not be combined with #[serde(skip_serializing_if = "...")]
--> $DIR/flatten-skip-serializing-if.rs:6:5
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
6 | / #[serde(flatten, skip_serializing_if = "Option::is_none")]
7 | | other: Option<Other>,
| |________________________^
error: aborting due to previous error
@@ -1,8 +1,9 @@
error: #[serde(flatten] can not be combined with #[serde(skip_serializing)]
--> $DIR/flatten-skip-serializing.rs:4:10
error: #[serde(flatten)] can not be combined with #[serde(skip_serializing)]
--> $DIR/flatten-skip-serializing.rs:6:5
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
6 | / #[serde(flatten, skip_serializing)]
7 | | other: Other,
| |________________^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: #[serde(flatten)] cannot be used on tuple structs
--> $DIR/flatten-tuple-struct.rs:4:10
--> $DIR/flatten-tuple-struct.rs:5:17
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
5 | struct Foo(u32, #[serde(flatten)] HashMap<String, String>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
@@ -1,8 +1,14 @@
error: variant field name `conflict` conflicts with internal tag
--> $DIR/internal-tag.rs:4:10
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
--> $DIR/internal-tag.rs:5:1
|
5 | / #[serde(tag = "conflict")]
6 | | enum E {
7 | | A {
8 | | #[serde(rename = "conflict")]
9 | | x: (),
10 | | },
11 | | }
| |_^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: #[serde(default)] can only be used on structs with named fields
--> $DIR/enum.rs:4:10
--> $DIR/enum.rs:6:1
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
6 | enum E {
| ^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: #[serde(default)] can only be used on structs with named fields
--> $DIR/nameless_struct_fields.rs:4:10
--> $DIR/nameless_struct_fields.rs:6:9
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
6 | struct T(u8, u8);
| ^^^^^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: unknown serde field attribute `serialize`
--> $DIR/rename-and-ser.rs:4:10
--> $DIR/rename-and-ser.rs:6:27
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
6 | #[serde(rename = "x", serialize = "y")]
| ^^^^^^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: duplicate serde attribute `rename`
--> $DIR/rename-rename-de.rs:4:10
--> $DIR/rename-rename-de.rs:7:13
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
7 | #[serde(rename(deserialize = "y"))]
| ^^^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: duplicate serde attribute `rename`
--> $DIR/rename-ser-rename-ser.rs:4:10
--> $DIR/rename-ser-rename-ser.rs:6:38
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
6 | #[serde(rename(serialize = "x"), rename(serialize = "y"))]
| ^^^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: duplicate serde attribute `rename`
--> $DIR/rename-ser-rename.rs:4:10
--> $DIR/rename-ser-rename.rs:7:13
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
7 | #[serde(rename = "y")]
| ^^^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: duplicate serde attribute `rename`
--> $DIR/rename-ser-ser.rs:4:10
--> $DIR/rename-ser-ser.rs:6:37
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
6 | #[serde(rename(serialize = "x", serialize = "y"))]
| ^^^^^^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: duplicate serde attribute `rename`
--> $DIR/two-rename-ser.rs:4:10
--> $DIR/two-rename-ser.rs:7:13
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
7 | #[serde(rename(serialize = "y"))]
| ^^^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: duplicate serde attribute `serialize_with`
--> $DIR/with-and-serialize-with.rs:4:10
--> $DIR/with-and-serialize-with.rs:6:25
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
6 | #[serde(with = "w", serialize_with = "s")]
| ^^^^^^^^^^^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: #[serde(tag = "...")] cannot be used with tuple variants
--> $DIR/internal-tuple-variant.rs:4:10
--> $DIR/internal-tuple-variant.rs:7:5
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
7 | Tuple(u8, u8),
| ^^^^^^^^^^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: #[serde(tag = "...")] can only be used on enums
--> $DIR/internally-tagged-struct.rs:4:10
--> $DIR/internally-tagged-struct.rs:6:1
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
6 | struct S;
| ^^^^^^
error: aborting due to previous error
@@ -1,8 +1,14 @@
error: enum cannot be both untagged and internally tagged
--> $DIR/untagged-and-internal.rs:4:10
--> $DIR/untagged-and-internal.rs:5:9
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
5 | #[serde(untagged)]
| ^^^^^^^^
error: aborting due to previous error
error: enum cannot be both untagged and internally tagged
--> $DIR/untagged-and-internal.rs:6:9
|
6 | #[serde(tag = "type")]
| ^^^
error: aborting due to 2 previous errors
@@ -1,8 +1,8 @@
error: #[serde(untagged)] can only be used on enums
--> $DIR/untagged-struct.rs:4:10
--> $DIR/untagged-struct.rs:6:1
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
6 | struct S;
| ^^^^^^
error: aborting due to previous error
+11 -5
View File
@@ -1,8 +1,14 @@
error: `field_identifier` and `variant_identifier` cannot both be set
--> $DIR/both.rs:4:10
error: #[serde(field_identifier)] and #[serde(variant_identifier)] cannot both be set
--> $DIR/both.rs:5:9
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
5 | #[serde(field_identifier, variant_identifier)]
| ^^^^^^^^^^^^^^^^
error: aborting due to previous error
error: #[serde(field_identifier)] and #[serde(variant_identifier)] cannot both be set
--> $DIR/both.rs:5:27
|
5 | #[serde(field_identifier, variant_identifier)]
| ^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
@@ -1,8 +1,8 @@
error: `field_identifier` can only be used on an enum
--> $DIR/field_struct.rs:4:10
error: #[serde(field_identifier)] can only be used on an enum
--> $DIR/field_struct.rs:6:1
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
6 | struct S;
| ^^^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: field_identifier may only contain unit variants
--> $DIR/field_tuple.rs:4:10
error: #[serde(field_identifier)] may only contain unit variants
--> $DIR/field_tuple.rs:8:5
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
8 | B(u8, u8),
| ^^^^^^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: `Other` must be the last variant
--> $DIR/newtype_not_last.rs:4:10
--> $DIR/newtype_not_last.rs:8:5
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
8 | Other(String),
| ^^^^^^^^^^^^^
error: aborting due to previous error
@@ -1,8 +1,9 @@
error: #[serde(other)] must be on a unit variant
--> $DIR/not_unit.rs:4:10
--> $DIR/not_unit.rs:8:5
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
8 | / #[serde(other)]
9 | | Other(u8, u8),
| |_________________^
error: aborting due to previous error
@@ -1,8 +1,9 @@
error: #[serde(other)] must be the last variant
--> $DIR/other_not_last.rs:4:10
error: #[serde(other)] must be on the last variant
--> $DIR/other_not_last.rs:8:5
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
8 | / #[serde(other)]
9 | | Other,
| |_________^
error: aborting due to previous error
@@ -1,8 +1,12 @@
error: field identifiers cannot be serialized
--> $DIR/serialize.rs:4:10
--> $DIR/serialize.rs:5:1
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
5 | / #[serde(field_identifier)]
6 | | enum F {
7 | | A,
8 | | B,
9 | | }
| |_^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: `variant_identifier` can only be used on an enum
--> $DIR/variant_struct.rs:4:10
error: #[serde(variant_identifier)] can only be used on an enum
--> $DIR/variant_struct.rs:6:1
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
6 | struct S;
| ^^^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: variant_identifier may only contain unit variants
--> $DIR/variant_tuple.rs:4:10
error: #[serde(variant_identifier)] may only contain unit variants
--> $DIR/variant_tuple.rs:8:5
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
8 | B(u8, u8),
| ^^^^^^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: cannot deserialize when there is a lifetime parameter called 'de
--> $DIR/deserialize_de_lifetime.rs:4:10
--> $DIR/deserialize_de_lifetime.rs:5:10
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
5 | struct S<'de> {
| ^^^
error: aborting due to previous error
@@ -1,8 +1,11 @@
error: cannot deserialize a dynamically sized struct
--> $DIR/deserialize_dst.rs:4:10
--> $DIR/deserialize_dst.rs:5:1
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
5 | / struct S {
6 | | string: String,
7 | | slice: [u8],
8 | | }
| |_^
error: aborting due to previous error
+3 -3
View File
@@ -1,8 +1,8 @@
error: failed to parse path: "~~~"
--> $DIR/bad_getter.rs:10:10
--> $DIR/bad_getter.rs:13:22
|
10 | #[derive(Serialize)]
| ^^^^^^^^^
13 | #[serde(getter = "~~~")]
| ^^^^^
error: aborting due to previous error
+3 -3
View File
@@ -1,8 +1,8 @@
error: failed to parse path: "~~~"
--> $DIR/bad_remote.rs:10:10
--> $DIR/bad_remote.rs:11:18
|
10 | #[derive(Serialize)]
| ^^^^^^^^^
11 | #[serde(remote = "~~~")]
| ^^^^^
error: aborting due to previous error
@@ -1,8 +1,14 @@
error: #[serde(getter = "...")] is not allowed in an enum
--> $DIR/enum_getter.rs:10:10
--> $DIR/enum_getter.rs:11:1
|
10 | #[derive(Serialize)]
| ^^^^^^^^^
11 | / #[serde(remote = "remote::E")]
12 | | pub enum E {
13 | | A {
14 | | #[serde(getter = "get_a")]
15 | | a: u8,
16 | | },
17 | | }
| |_^
error: aborting due to previous error
@@ -1,8 +1,11 @@
error: #[serde(getter = "...")] can only be used in structs that have #[serde(remote = "...")]
--> $DIR/nonremote_getter.rs:4:10
--> $DIR/nonremote_getter.rs:5:1
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
5 | / struct S {
6 | | #[serde(getter = "S::get")]
7 | | a: u8,
8 | | }
| |_^
error: aborting due to previous error
@@ -1,8 +1,12 @@
error: #[serde(transparent)] requires struct to have at most one transparent field
--> $DIR/at_most_one.rs:4:10
--> $DIR/at_most_one.rs:5:1
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
5 | / #[serde(transparent)]
6 | | struct S {
7 | | a: u8,
8 | | b: u8,
9 | | }
| |_^
error: aborting due to previous error
@@ -1,8 +1,14 @@
error: #[serde(transparent)] requires at least one field that is neither skipped nor has a default
--> $DIR/de_at_least_one.rs:4:10
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
--> $DIR/de_at_least_one.rs:5:1
|
5 | / #[serde(transparent)]
6 | | struct S {
7 | | #[serde(skip)]
8 | | a: u8,
9 | | #[serde(default)]
10 | | b: u8,
11 | | }
| |_^
error: aborting due to previous error
@@ -1,8 +1,12 @@
error: #[serde(transparent)] requires at least one field that is not skipped
--> $DIR/ser_at_least_one.rs:4:10
--> $DIR/ser_at_least_one.rs:5:1
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
5 | / #[serde(transparent)]
6 | | struct S {
7 | | #[serde(skip)]
8 | | a: u8,
9 | | }
| |_^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: failed to parse type: from = "Option<T"
--> $DIR/from.rs:4:10
--> $DIR/from.rs:5:16
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
5 | #[serde(from = "Option<T")]
| ^^^^^^^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: failed to parse type: into = "Option<T"
--> $DIR/into.rs:4:10
--> $DIR/into.rs:5:16
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
5 | #[serde(into = "Option<T")]
| ^^^^^^^^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: unknown serde container attribute `abc`
--> $DIR/container.rs:4:10
--> $DIR/container.rs:5:9
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
5 | #[serde(abc = "xyz")]
| ^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: unknown serde field attribute `abc`
--> $DIR/field.rs:4:10
--> $DIR/field.rs:6:13
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
6 | #[serde(abc = "xyz")]
| ^^^
error: aborting due to previous error
@@ -1,8 +1,8 @@
error: unknown serde variant attribute `abc`
--> $DIR/variant.rs:4:10
--> $DIR/variant.rs:6:13
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
6 | #[serde(abc = "xyz")]
| ^^^
error: aborting due to previous error
@@ -1,8 +1,9 @@
error: variant `Newtype` cannot have both #[serde(deserialize_with)] and a field 0 marked with #[serde(skip_deserializing)]
--> $DIR/skip_de_newtype_field.rs:4:10
error: variant `Newtype` cannot have both #[serde(deserialize_with)] and a field #0 marked with #[serde(skip_deserializing)]
--> $DIR/skip_de_newtype_field.rs:6:5
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
6 | / #[serde(deserialize_with = "deserialize_some_newtype_variant")]
7 | | Newtype(#[serde(skip_deserializing)] String),
| |________________________________________________^
error: aborting due to previous error
@@ -1,8 +1,13 @@
error: variant `Struct` cannot have both #[serde(deserialize_with)] and a field `f1` marked with #[serde(skip_deserializing)]
--> $DIR/skip_de_struct_field.rs:4:10
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
--> $DIR/skip_de_struct_field.rs:6:5
|
6 | / #[serde(deserialize_with = "deserialize_some_other_variant")]
7 | | Struct {
8 | | #[serde(skip_deserializing)]
9 | | f1: String,
10 | | f2: u8,
11 | | },
| |_____^
error: aborting due to previous error
@@ -1,8 +1,9 @@
error: variant `Tuple` cannot have both #[serde(deserialize_with)] and a field 0 marked with #[serde(skip_deserializing)]
--> $DIR/skip_de_tuple_field.rs:4:10
error: variant `Tuple` cannot have both #[serde(deserialize_with)] and a field #0 marked with #[serde(skip_deserializing)]
--> $DIR/skip_de_tuple_field.rs:6:5
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
6 | / #[serde(deserialize_with = "deserialize_some_other_variant")]
7 | | Tuple(#[serde(skip_deserializing)] String, u8),
| |__________________________________________________^
error: aborting due to previous error
@@ -1,8 +1,10 @@
error: variant `Unit` cannot have both #[serde(deserialize_with)] and #[serde(skip_deserializing)]
--> $DIR/skip_de_whole_variant.rs:4:10
--> $DIR/skip_de_whole_variant.rs:6:5
|
4 | #[derive(Deserialize)]
| ^^^^^^^^^^^
6 | / #[serde(deserialize_with = "deserialize_some_unit_variant")]
7 | | #[serde(skip_deserializing)]
8 | | Unit,
| |________^
error: aborting due to previous error
@@ -1,8 +1,9 @@
error: variant `Newtype` cannot have both #[serde(serialize_with)] and a field 0 marked with #[serde(skip_serializing)]
--> $DIR/skip_ser_newtype_field.rs:4:10
error: variant `Newtype` cannot have both #[serde(serialize_with)] and a field #0 marked with #[serde(skip_serializing)]
--> $DIR/skip_ser_newtype_field.rs:6:5
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
6 | / #[serde(serialize_with = "serialize_some_newtype_variant")]
7 | | Newtype(#[serde(skip_serializing)] String),
| |______________________________________________^
error: aborting due to previous error
@@ -1,8 +1,9 @@
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:4:10
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:6:5
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
6 | / #[serde(serialize_with = "serialize_some_newtype_variant")]
7 | | Newtype(#[serde(skip_serializing_if = "always")] String),
| |____________________________________________________________^
error: aborting due to previous error
@@ -1,8 +1,13 @@
error: variant `Struct` cannot have both #[serde(serialize_with)] and a field `f1` marked with #[serde(skip_serializing)]
--> $DIR/skip_ser_struct_field.rs:4:10
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
--> $DIR/skip_ser_struct_field.rs:6:5
|
6 | / #[serde(serialize_with = "serialize_some_other_variant")]
7 | | Struct {
8 | | #[serde(skip_serializing)]
9 | | f1: String,
10 | | f2: u8,
11 | | },
| |_____^
error: aborting due to previous error
@@ -1,8 +1,13 @@
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:4:10
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
--> $DIR/skip_ser_struct_field_if.rs:6:5
|
6 | / #[serde(serialize_with = "serialize_some_newtype_variant")]
7 | | Struct {
8 | | #[serde(skip_serializing_if = "always")]
9 | | f1: String,
10 | | f2: u8,
11 | | },
| |_____^
error: aborting due to previous error
@@ -1,8 +1,9 @@
error: variant `Tuple` cannot have both #[serde(serialize_with)] and a field 0 marked with #[serde(skip_serializing)]
--> $DIR/skip_ser_tuple_field.rs:4:10
error: variant `Tuple` cannot have both #[serde(serialize_with)] and a field #0 marked with #[serde(skip_serializing)]
--> $DIR/skip_ser_tuple_field.rs:6:5
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
6 | / #[serde(serialize_with = "serialize_some_other_variant")]
7 | | Tuple(#[serde(skip_serializing)] String, u8),
| |________________________________________________^
error: aborting due to previous error
@@ -1,8 +1,9 @@
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:4:10
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:6:5
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
6 | / #[serde(serialize_with = "serialize_some_other_variant")]
7 | | Tuple(#[serde(skip_serializing_if = "always")] String, u8),
| |______________________________________________________________^
error: aborting due to previous error
@@ -1,8 +1,10 @@
error: variant `Unit` cannot have both #[serde(serialize_with)] and #[serde(skip_serializing)]
--> $DIR/skip_ser_whole_variant.rs:4:10
--> $DIR/skip_ser_whole_variant.rs:6:5
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
6 | / #[serde(serialize_with = "serialize_some_unit_variant")]
7 | | #[serde(skip_serializing)]
8 | | Unit,
| |________^
error: aborting due to previous error