]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/default_type_parameter_default_dependent_associated_type.rs
Remove defaults table and attach defaults directly to tyvars
[rust.git] / src / test / run-pass / default_type_parameter_default_dependent_associated_type.rs
1 use std::marker::PhantomData;
2
3 trait Id {
4     type This;
5 }
6
7 impl<A> Id for A {
8     type This = A;
9 }
10
11 struct Foo<X: Default = usize, Y = <X as Id>::This> {
12     data: PhantomData<(X, Y)>
13 }
14
15 impl<X: Default, Y> Foo<X, Y> {
16     fn new() -> Foo<X, Y> {
17         Foo { data: PhantomData }
18     }
19 }
20
21 fn main() {
22     let foo = Foo::new();
23 }