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