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 borrowed lifetimes: "zzz"
--> tests/ui/borrow/bad_lifetimes.rs:5:22
|
3 | #[derive(Deserialize)]
| ----------- in this derive macro expansion
4 | struct Test<'a> {
5 | #[serde(borrow = "zzz")]
| ^^^^^
|
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,5 +1,10 @@
error: duplicate borrowed lifetime `'a`
--> tests/ui/borrow/duplicate_lifetime.rs:5:22
|
3 | #[derive(Deserialize)]
| ----------- in this derive macro expansion
4 | struct Test<'a> {
5 | #[serde(borrow = "'a + 'a")]
| ^^^^^^^^^
|
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,5 +1,10 @@
error: duplicate serde attribute `borrow`
--> tests/ui/borrow/duplicate_variant.rs:9:15
|
6 | #[derive(Deserialize)]
| ----------- in this derive macro expansion
...
9 | S(#[serde(borrow)] Str<'a>),
| ^^^^^^
|
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,11 +1,21 @@
error: at least one lifetime must be borrowed
--> tests/ui/borrow/empty_lifetimes.rs:5:22
|
3 | #[derive(Deserialize)]
| ----------- in this derive macro expansion
4 | struct Test<'a> {
5 | #[serde(borrow = "")]
| ^^
|
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
error: at least one lifetime must be borrowed
--> tests/ui/borrow/empty_lifetimes.rs:7:22
|
3 | #[derive(Deserialize)]
| ----------- in this derive macro expansion
...
7 | #[serde(borrow = " ")]
| ^^^^
|
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,6 +1,11 @@
error: field `s` has no lifetimes to borrow
--> tests/ui/borrow/no_lifetimes.rs:5:5
|
3 | #[derive(Deserialize)]
| ----------- in this derive macro expansion
4 | struct Test {
5 | / #[serde(borrow)]
6 | | s: String,
| |_____________^
|
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,6 +1,11 @@
error: #[serde(borrow)] may only be used on newtype variants
--> tests/ui/borrow/struct_variant.rs:8:5
|
6 | #[derive(Deserialize)]
| ----------- in this derive macro expansion
7 | enum Test<'a> {
8 | / #[serde(borrow)]
9 | | S { s: Str<'a> },
| |____________________^
|
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,6 +1,11 @@
error: field `s` does not have lifetime 'b
--> tests/ui/borrow/wrong_lifetime.rs:5:5
|
3 | #[derive(Deserialize)]
| ----------- in this derive macro expansion
4 | struct Test<'a> {
5 | / #[serde(borrow = "'b")]
6 | | s: &'a str,
| |______________^
|
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)