]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-63355.rs
Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
[rust.git] / src / test / ui / type-alias-impl-trait / issue-63355.rs
1 #![feature(type_alias_impl_trait)]
2 // check-pass
3
4 pub trait Foo {}
5
6 pub trait Bar {
7     type Foo: Foo;
8
9     fn foo() -> Self::Foo;
10 }
11
12 pub trait Baz {
13     type Foo: Foo;
14     type Bar: Bar<Foo = Self::Foo>;
15
16     fn foo() -> Self::Foo;
17     fn bar() -> Self::Bar;
18 }
19
20 impl Foo for () {}
21
22 impl Bar for () {
23     type Foo = FooImpl;
24
25     fn foo() -> Self::Foo {
26         ()
27     }
28 }
29
30 pub type FooImpl = impl Foo;
31 pub type BarImpl = impl Bar<Foo = FooImpl>;
32
33 impl Baz for () {
34     type Foo = FooImpl;
35     type Bar = BarImpl;
36
37     fn foo() -> Self::Foo {
38         ()
39     }
40
41     fn bar() -> Self::Bar {
42         ()
43     }
44 }
45
46 fn main() {}