]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/recursive-type-alias-impl-trait-declaration.rs
Rollup merge of #93742 - Mark-Simulacrum:skip-rustc-docs-complete, r=pietroalbini
[rust.git] / src / test / ui / impl-trait / recursive-type-alias-impl-trait-declaration.rs
1 // check-pass
2
3 #![feature(type_alias_impl_trait)]
4
5 mod direct {
6     type Foo = impl PartialEq<(Foo, i32)>;
7
8     struct Bar;
9
10     impl PartialEq<(Foo, i32)> for Bar {
11         fn eq(&self, _other: &(Foo, i32)) -> bool {
12             true
13         }
14     }
15
16     fn foo() -> Foo {
17         Bar
18     }
19 }
20
21 mod indirect {
22     type Foo = impl PartialEq<(Foo, i32)>;
23
24     struct Bar;
25
26     impl PartialEq<(Bar, i32)> for Bar {
27         fn eq(&self, _other: &(Bar, i32)) -> bool {
28             true
29         }
30     }
31
32     fn foo() -> Foo {
33         Bar
34     }
35 }
36
37 fn main() {}