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,10 @@
error: failed to parse path: "~~~"
--> tests/ui/remote/bad_getter.rs:12:22
|
9 | #[derive(Serialize)]
| --------- in this derive macro expansion
...
12 | #[serde(getter = "~~~")]
| ^^^^^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,5 +1,9 @@
error: failed to parse path: "~~~"
--> tests/ui/remote/bad_remote.rs:10:18
|
9 | #[derive(Serialize)]
| --------- in this derive macro expansion
10 | #[serde(remote = "~~~")]
| ^^^^^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,5 +1,19 @@
error: remove generic parameters from this path
--> tests/ui/remote/double_generic.rs:11:18
|
10 | #[derive(Serialize, Deserialize)]
| --------- in this derive macro expansion
11 | #[serde(remote = "remote::StructGeneric<u8>")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
error: remove generic parameters from this path
--> tests/ui/remote/double_generic.rs:11:18
|
10 | #[derive(Serialize, Deserialize)]
| ----------- in this derive macro expansion
11 | #[serde(remote = "remote::StructGeneric<u8>")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,6 +1,8 @@
error: #[serde(getter = "...")] is not allowed in an enum
--> tests/ui/remote/enum_getter.rs:10:1
|
9 | #[derive(Serialize)]
| --------- in this derive macro expansion
10 | / #[serde(remote = "remote::E")]
11 | | pub enum E {
12 | | A {
@@ -9,3 +11,5 @@ error: #[serde(getter = "...")] is not allowed in an enum
15 | | },
16 | | }
| |_^
|
= 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(getter = "...")] can only be used in structs that have #[serde(remote = "...")]
--> tests/ui/remote/nonremote_getter.rs:4:1
|
3 | #[derive(Serialize)]
| --------- in this derive macro expansion
4 | / struct S {
5 | | #[serde(getter = "S::get")]
6 | | a: u8,
7 | | }
| |_^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)