Skip to content

Commit

Permalink
Add ui test with suffixed string literals in attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jul 9, 2023
1 parent 3fb5e71 commit 117ef22
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test_suite/tests/ui/malformed/str_suffix.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use serde::Serialize;

#[derive(Serialize)]
#[serde(bound = ""huh)]
pub struct Struct {
#[serde(rename = ""what)]
pub field: i32,
}

fn main() {}
11 changes: 11 additions & 0 deletions test_suite/tests/ui/malformed/str_suffix.stderr
Original file line number Diff line number Diff line change
@@ -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)]
| ^^^^^^

0 comments on commit 117ef22

Please sign in to comment.