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,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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user