Ui tests with compile_error resolved at call site

This commit is contained in:
David Tolnay
2023-06-07 20:02:04 -07:00
parent 1aebdc2760
commit e77db40b8d
92 changed files with 467 additions and 0 deletions
@@ -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)