From 117ef22142db12eea644b91610592cd5edc20b78 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 9 Jul 2023 11:09:20 -0700 Subject: [PATCH] Add ui test with suffixed string literals in attribute --- test_suite/tests/ui/malformed/str_suffix.rs | 10 ++++++++++ test_suite/tests/ui/malformed/str_suffix.stderr | 11 +++++++++++ 2 files changed, 21 insertions(+) create mode 100644 test_suite/tests/ui/malformed/str_suffix.rs create mode 100644 test_suite/tests/ui/malformed/str_suffix.stderr diff --git a/test_suite/tests/ui/malformed/str_suffix.rs b/test_suite/tests/ui/malformed/str_suffix.rs new file mode 100644 index 00000000..836842ee --- /dev/null +++ b/test_suite/tests/ui/malformed/str_suffix.rs @@ -0,0 +1,10 @@ +use serde::Serialize; + +#[derive(Serialize)] +#[serde(bound = ""huh)] +pub struct Struct { + #[serde(rename = ""what)] + pub field: i32, +} + +fn main() {} diff --git a/test_suite/tests/ui/malformed/str_suffix.stderr b/test_suite/tests/ui/malformed/str_suffix.stderr new file mode 100644 index 00000000..3d4beae6 --- /dev/null +++ b/test_suite/tests/ui/malformed/str_suffix.stderr @@ -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)] + | ^^^^^^