serde/test_suite/tests/expand/default_ty_param.rs
2019-11-25 23:57:34 -08:00

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>,
}