mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-22 18:27:54 +00:00
Improve overall quality of compile_error! errors
Also updates UI tests.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user