15 lines
250 B
Rust
15 lines
250 B
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
trait AssociatedType {
|
|
type X;
|
|
}
|
|
|
|
impl AssociatedType for i32 {
|
|
type X = i32;
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize)]
|
|
struct DefaultTyParam<T: AssociatedType<X = i32> = i32> {
|
|
phantom: PhantomData<T>,
|
|
}
|