2016-03-01 09:39:43 -06:00
|
|
|
trait FooTrait<T>: Sized {
|
|
|
|
type Bar: BarTrait<T>;
|
|
|
|
}
|
|
|
|
|
|
|
|
trait BarTrait<T>: Sized {
|
|
|
|
type Baz;
|
|
|
|
fn foo();
|
|
|
|
}
|
|
|
|
|
2017-03-06 19:53:10 -06:00
|
|
|
type Foo<T: FooTrait> = <<T as FooTrait<U>>::Bar as BarTrait<U>>::Baz;
|
2016-03-01 09:39:43 -06:00
|
|
|
type Bar<T: BarTrait> = <T as BarTrait<U>>::Baz;
|
|
|
|
|
|
|
|
fn some_func<T: FooTrait<U>, U>() {
|
|
|
|
<<T as FooTrait<U>>::Bar as BarTrait<U>>::foo();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn some_func<T: BarTrait<U>>() {
|
|
|
|
<T as BarTrait<U>>::foo();
|
|
|
|
}
|