Add ui test with nonempty string containing no lifetimes

This commit is contained in:
David Tolnay 2023-03-08 18:49:59 -08:00
parent eb1e8c140d
commit b1b09eba60
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 8 additions and 0 deletions

View File

@ -3,6 +3,8 @@ use serde_derive::Deserialize;
#[derive(Deserialize)]
struct Test<'a> {
#[serde(borrow = "")]
r: &'a str,
#[serde(borrow = " ")]
s: &'a str,
}

View File

@ -3,3 +3,9 @@ error: at least one lifetime must be borrowed
|
5 | #[serde(borrow = "")]
| ^^
error: failed to parse borrowed lifetimes: " "
--> tests/ui/borrow/empty_lifetimes.rs:7:22
|
7 | #[serde(borrow = " ")]
| ^^^^