mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-22 21:48:02 +00:00
Add associated type test
This commit is contained in:
@@ -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>>();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user