serde/serde_macros/tests/compile-fail/reject-unknown-attributes.rs

31 lines
570 B
Rust
Raw Normal View History

#![feature(custom_attribute, custom_derive, plugin)]
#![plugin(serde_macros)]
extern crate serde;
2016-09-27 00:17:00 -07:00
#[derive(Serialize)] //~ unknown serde container attribute `abc`
#[serde(abc="xyz")]
struct Foo {
x: u32,
}
2016-09-27 00:17:00 -07:00
#[derive(Deserialize)] //~ unknown serde container attribute `abc`
#[serde(abc="xyz")]
struct Foo {
x: u32,
}
2016-09-27 00:17:00 -07:00
#[derive(Serialize)] //~ unknown serde field attribute `abc`
struct Foo {
2016-09-27 00:17:00 -07:00
#[serde(abc="xyz")]
x: u32,
}
2016-09-27 00:17:00 -07:00
#[derive(Deserialize)] //~ unknown serde field attribute `abc`
struct Foo {
2016-09-27 00:17:00 -07:00
#[serde(abc="xyz")]
x: u32,
}
fn main() { }