Skip to content

Commit

Permalink
Add ui test of malformed attribute containing expression
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Mar 16, 2023
1 parent 5467125 commit c0296ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test_suite/tests/ui/malformed/trailing_expr.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use serde_derive::Serialize;

#[derive(Serialize)]
struct S {
#[serde(skip_serializing_if, x.is_empty())]
x: Vec<()>,
}

fn main() {}
5 changes: 5 additions & 0 deletions test_suite/tests/ui/malformed/trailing_expr.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
error: expected `,`
--> tests/ui/malformed/trailing_expr.rs:5:35
|
5 | #[serde(skip_serializing_if, x.is_empty())]
| ^

0 comments on commit c0296ee

Please sign in to comment.