diff --git a/test_suite/tests/ui/malformed/cut_off.rs b/test_suite/tests/ui/malformed/cut_off.rs new file mode 100644 index 00000000..345731a1 --- /dev/null +++ b/test_suite/tests/ui/malformed/cut_off.rs @@ -0,0 +1,7 @@ +use serde_derive::Serialize; + +#[derive(Serialize)] +#[serde(rename =)] +struct S; + +fn main() {} diff --git a/test_suite/tests/ui/malformed/cut_off.stderr b/test_suite/tests/ui/malformed/cut_off.stderr new file mode 100644 index 00000000..d3945c30 --- /dev/null +++ b/test_suite/tests/ui/malformed/cut_off.stderr @@ -0,0 +1,5 @@ +error: unexpected end of input, expected literal + --> $DIR/cut_off.rs:4:17 + | +4 | #[serde(rename =)] + | ^ diff --git a/test_suite/tests/ui/malformed/not_list.rs b/test_suite/tests/ui/malformed/not_list.rs new file mode 100644 index 00000000..dc88f1ca --- /dev/null +++ b/test_suite/tests/ui/malformed/not_list.rs @@ -0,0 +1,8 @@ +use serde_derive::Serialize; + +#[derive(Serialize)] +#[serde] +#[serde = "?"] +struct S; + +fn main() {} diff --git a/test_suite/tests/ui/malformed/not_list.stderr b/test_suite/tests/ui/malformed/not_list.stderr new file mode 100644 index 00000000..31eae65d --- /dev/null +++ b/test_suite/tests/ui/malformed/not_list.stderr @@ -0,0 +1,11 @@ +error: expected #[serde(...)] + --> $DIR/not_list.rs:4:3 + | +4 | #[serde] + | ^^^^^ + +error: expected #[serde(...)] + --> $DIR/not_list.rs:5:3 + | +5 | #[serde = "?"] + | ^^^^^^^^^^^