Add ui test with suffixed string literals in attribute

This commit is contained in:
David Tolnay 2023-07-09 11:09:20 -07:00
parent 3fb5e71c33
commit 117ef22142
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,10 @@
use serde::Serialize;
#[derive(Serialize)]
#[serde(bound = ""huh)]
pub struct Struct {
#[serde(rename = ""what)]
pub field: i32,
}
fn main() {}

View File

@ -0,0 +1,11 @@
error: unexpected suffix `huh` on string literal
--> tests/ui/malformed/str_suffix.rs:4:17
|
4 | #[serde(bound = ""huh)]
| ^^^^^
error: unexpected suffix `what` on string literal
--> tests/ui/malformed/str_suffix.rs:6:22
|
6 | #[serde(rename = ""what)]
| ^^^^^^