]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/impl_trait_for_generic_tait.rs
Rollup merge of #106732 - durin42:dmitrig-arrayref-ctor, r=nikic
[rust.git] / tests / ui / type-alias-impl-trait / impl_trait_for_generic_tait.rs
1 // check-pass
2
3 #![feature(type_alias_impl_trait)]
4 trait Foo {
5     type Assoc;
6 }
7
8 impl Foo for i32 {
9     type Assoc = u32;
10 }
11 type ImplTrait = impl Sized;
12 fn constrain() -> ImplTrait {
13     1u64
14 }
15 impl Foo for i64 {
16     type Assoc = ImplTrait;
17 }
18
19 trait Bar<T> {}
20
21 impl<T: Foo> Bar<<T as Foo>::Assoc> for T {}
22
23 fn main() {}