Detect incorrect remote type without getter

This commit is contained in:
David Tolnay
2017-04-10 12:12:00 -07:00
parent 78f682590a
commit 2deacf8eaa
2 changed files with 33 additions and 4 deletions
@@ -0,0 +1,16 @@
#[macro_use]
extern crate serde_derive;
mod remote {
pub struct S {
pub a: u16,
}
}
#[derive(Serialize)] //~ ERROR: mismatched types
#[serde(remote = "remote::S")]
struct S {
a: u8, //~^^^ expected u8, found u16
}
fn main() {}