summaryrefslogtreecommitdiffstats
path: root/tests/ui/type-alias-impl-trait/impl_trait_for_generic_tait.rs
blob: 0efbd1c2bd5fd4cb4700a04957722f6d82bab782 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// check-pass

#![feature(type_alias_impl_trait)]
trait Foo {
    type Assoc;
}

impl Foo for i32 {
    type Assoc = u32;
}
type ImplTrait = impl Sized;
fn constrain() -> ImplTrait {
    1u64
}
impl Foo for i64 {
    type Assoc = ImplTrait;
}

trait Bar<T> {}

impl<T: Foo> Bar<<T as Foo>::Assoc> for T {}

fn main() {}