Add associated type test
This commit is contained in:
parent
2e824e9aba
commit
def8d6e8af
@ -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>>();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user