mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-22 14:57:59 +00:00
Ui tests with compile_error resolved at call site
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
error: #[serde(transparent)] requires struct to have at most one transparent field
|
||||
--> tests/ui/transparent/at_most_one.rs:4:1
|
||||
|
|
||||
3 | #[derive(Serialize)]
|
||||
| --------- in this derive macro expansion
|
||||
4 | / #[serde(transparent)]
|
||||
5 | | struct S {
|
||||
6 | | a: u8,
|
||||
7 | | b: u8,
|
||||
8 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
error: #[serde(transparent)] requires at least one field that is neither skipped nor has a default
|
||||
--> tests/ui/transparent/de_at_least_one.rs:4:1
|
||||
|
|
||||
3 | #[derive(Deserialize)]
|
||||
| ----------- in this derive macro expansion
|
||||
4 | / #[serde(transparent)]
|
||||
5 | | struct S {
|
||||
6 | | #[serde(skip)]
|
||||
@@ -9,3 +11,5 @@ error: #[serde(transparent)] requires at least one field that is neither skipped
|
||||
9 | | b: u8,
|
||||
10 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
error: #[serde(transparent)] is not allowed on an enum
|
||||
--> tests/ui/transparent/enum.rs:4:1
|
||||
|
|
||||
3 | #[derive(Serialize)]
|
||||
| --------- in this derive macro expansion
|
||||
4 | / #[serde(transparent)]
|
||||
5 | | enum E {}
|
||||
| |_________^
|
||||
|
|
||||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
error: #[serde(transparent)] requires at least one field that is not skipped
|
||||
--> tests/ui/transparent/ser_at_least_one.rs:4:1
|
||||
|
|
||||
3 | #[derive(Serialize)]
|
||||
| --------- in this derive macro expansion
|
||||
4 | / #[serde(transparent)]
|
||||
5 | | struct S {
|
||||
6 | | #[serde(skip)]
|
||||
7 | | a: u8,
|
||||
8 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
error: #[serde(transparent)] is not allowed on a unit struct
|
||||
--> tests/ui/transparent/unit_struct.rs:4:1
|
||||
|
|
||||
3 | #[derive(Serialize)]
|
||||
| --------- in this derive macro expansion
|
||||
4 | / #[serde(transparent)]
|
||||
5 | | struct S;
|
||||
| |_________^
|
||||
|
|
||||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
error: #[serde(transparent)] is not allowed with #[serde(from = "...")]
|
||||
--> tests/ui/transparent/with_from.rs:4:1
|
||||
|
|
||||
3 | #[derive(Serialize)]
|
||||
| --------- in this derive macro expansion
|
||||
4 | / #[serde(transparent, from = "u64")]
|
||||
5 | | struct S {
|
||||
6 | | a: u8,
|
||||
7 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
error: #[serde(transparent)] is not allowed with #[serde(into = "...")]
|
||||
--> tests/ui/transparent/with_into.rs:4:1
|
||||
|
|
||||
3 | #[derive(Serialize)]
|
||||
| --------- in this derive macro expansion
|
||||
4 | / #[serde(transparent, into = "u64")]
|
||||
5 | | struct S {
|
||||
6 | | a: u8,
|
||||
7 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
error: #[serde(transparent)] is not allowed with #[serde(try_from = "...")]
|
||||
--> tests/ui/transparent/with_try_from.rs:4:1
|
||||
|
|
||||
3 | #[derive(Serialize)]
|
||||
| --------- in this derive macro expansion
|
||||
4 | / #[serde(transparent, try_from = "u64")]
|
||||
5 | | struct S {
|
||||
6 | | a: u8,
|
||||
7 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
Reference in New Issue
Block a user