Add associated type test

This commit is contained in:
Osspial 2018-04-10 11:16:23 -04:00
parent 2e824e9aba
commit def8d6e8af

View File

@ -539,6 +539,22 @@ fn test_gen() {
array: [u8; 256],
}
assert_ser::<BigArray>();
trait AssocSerde {
type Assoc;
}
struct NoSerdeImpl;
impl AssocSerde for NoSerdeImpl {
type Assoc = u32;
}
#[derive(Serialize, Deserialize)]
struct AssocDerive<T: AssocSerde> {
assoc: T::Assoc
}
assert::<AssocDerive<NoSerdeImpl>>();
}
//////////////////////////////////////////////////////////////////////////