Add tests for attribute parse errors

This commit is contained in:
David Tolnay 2019-09-07 22:57:27 -07:00
parent a3157c9572
commit e46463e69f
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
4 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,7 @@
use serde_derive::Serialize;
#[derive(Serialize)]
#[serde(rename =)]
struct S;
fn main() {}

View File

@ -0,0 +1,5 @@
error: unexpected end of input, expected literal
--> $DIR/cut_off.rs:4:17
|
4 | #[serde(rename =)]
| ^

View File

@ -0,0 +1,8 @@
use serde_derive::Serialize;
#[derive(Serialize)]
#[serde]
#[serde = "?"]
struct S;
fn main() {}

View File

@ -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 = "?"]
| ^^^^^^^^^^^