1 use serde::{Deserialize, Serialize}; 2 3 trait AssociatedType { 4 type X; 5 } 6 7 impl AssociatedType for i32 { 8 type X = i32; 9 } 10 11 #[derive(Serialize, Deserialize)] 12 struct DefaultTyParam<T: AssociatedType<X = i32> = i32> { 13 phantom: PhantomData<T>, 14 } 15