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,5 +1,9 @@
error: #[serde(tag = "...", content = "...")] must be used together
--> tests/ui/enum-representation/content-no-tag.rs:4:9
|
3 | #[derive(Serialize)]
| --------- in this derive macro expansion
4 | #[serde(content = "c")]
| ^^^^^^^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,5 +1,10 @@
error: #[serde(tag = "...")] cannot be used with tuple variants
--> tests/ui/enum-representation/internal-tuple-variant.rs:6:5
|
3 | #[derive(Serialize)]
| --------- in this derive macro expansion
...
6 | Tuple(u8, u8),
| ^^^^^^^^^^^^^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,17 +1,31 @@
error: untagged enum cannot have #[serde(tag = "...", content = "...")]
--> tests/ui/enum-representation/untagged-and-adjacent.rs:4:9
|
3 | #[derive(Serialize)]
| --------- in this derive macro expansion
4 | #[serde(untagged)]
| ^^^^^^^^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
error: untagged enum cannot have #[serde(tag = "...", content = "...")]
--> tests/ui/enum-representation/untagged-and-adjacent.rs:5:9
|
3 | #[derive(Serialize)]
| --------- in this derive macro expansion
4 | #[serde(untagged)]
5 | #[serde(tag = "t", content = "c")]
| ^^^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
error: untagged enum cannot have #[serde(tag = "...", content = "...")]
--> tests/ui/enum-representation/untagged-and-adjacent.rs:5:20
|
3 | #[derive(Serialize)]
| --------- in this derive macro expansion
4 | #[serde(untagged)]
5 | #[serde(tag = "t", content = "c")]
| ^^^^^^^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,11 +1,20 @@
error: untagged enum cannot have #[serde(content = "...")]
--> tests/ui/enum-representation/untagged-and-content.rs:4:9
|
3 | #[derive(Serialize)]
| --------- in this derive macro expansion
4 | #[serde(untagged)]
| ^^^^^^^^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
error: untagged enum cannot have #[serde(content = "...")]
--> tests/ui/enum-representation/untagged-and-content.rs:5:9
|
3 | #[derive(Serialize)]
| --------- in this derive macro expansion
4 | #[serde(untagged)]
5 | #[serde(content = "c")]
| ^^^^^^^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,11 +1,20 @@
error: enum cannot be both untagged and internally tagged
--> tests/ui/enum-representation/untagged-and-internal.rs:4:9
|
3 | #[derive(Serialize)]
| --------- in this derive macro expansion
4 | #[serde(untagged)]
| ^^^^^^^^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
error: enum cannot be both untagged and internally tagged
--> tests/ui/enum-representation/untagged-and-internal.rs:5:9
|
3 | #[derive(Serialize)]
| --------- in this derive macro expansion
4 | #[serde(untagged)]
5 | #[serde(tag = "type")]
| ^^^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,5 +1,10 @@
error: #[serde(untagged)] can only be used on enums
--> tests/ui/enum-representation/untagged-struct.rs:5:1
|
3 | #[derive(Serialize)]
| --------- in this derive macro expansion
4 | #[serde(untagged)]
5 | struct S;
| ^^^^^^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)