]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/associated-type-alias-impl-trait.rs
Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
[rust.git] / src / test / ui / type-alias-impl-trait / associated-type-alias-impl-trait.rs
1 #![feature(type_alias_impl_trait)]
2 // build-pass (FIXME(62277): could be check-pass?)
3
4 trait Bar {}
5 struct Dummy;
6 impl Bar for Dummy {}
7
8 trait Foo {
9     type Assoc: Bar;
10     fn foo() -> Self::Assoc;
11     fn bar() -> Self::Assoc;
12 }
13
14 type Helper = impl Bar;
15
16 impl Foo for i32 {
17     type Assoc = Helper;
18     fn foo() -> Helper {
19         Dummy
20     }
21     fn bar() -> Helper {
22         Dummy
23     }
24 }
25
26 fn main() {}