serde/test_suite/tests/expand/default_ty_param.rs

15 lines
250 B
Rust
Raw Normal View History

2019-11-26 01:57:34 -06:00
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>,
}