diff options
Diffstat (limited to 'tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration.rs')
-rw-r--r-- | tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration.rs b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration.rs new file mode 100644 index 000000000..ad0a003e8 --- /dev/null +++ b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration.rs @@ -0,0 +1,19 @@ +// check-pass + +#![feature(type_alias_impl_trait)] + +type Foo = impl PartialEq<(Foo, i32)>; + +struct Bar; + +impl PartialEq<(Bar, i32)> for Bar { + fn eq(&self, _other: &(Bar, i32)) -> bool { + true + } +} + +fn foo() -> Foo { + Bar +} + +fn main() {} |