diff options
Diffstat (limited to 'tests/ui/type-alias-impl-trait/issue-63355.rs')
-rw-r--r-- | tests/ui/type-alias-impl-trait/issue-63355.rs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/ui/type-alias-impl-trait/issue-63355.rs b/tests/ui/type-alias-impl-trait/issue-63355.rs new file mode 100644 index 000000000..7066a0535 --- /dev/null +++ b/tests/ui/type-alias-impl-trait/issue-63355.rs @@ -0,0 +1,46 @@ +#![feature(type_alias_impl_trait)] +// check-pass + +pub trait Foo {} + +pub trait Bar { + type Foo: Foo; + + fn foo() -> Self::Foo; +} + +pub trait Baz { + type Foo: Foo; + type Bar: Bar<Foo = Self::Foo>; + + fn foo() -> Self::Foo; + fn bar() -> Self::Bar; +} + +impl Foo for () {} + +impl Bar for () { + type Foo = FooImpl; + + fn foo() -> Self::Foo { + () + } +} + +pub type FooImpl = impl Foo; +pub type BarImpl = impl Bar<Foo = FooImpl>; + +impl Baz for () { + type Foo = FooImpl; + type Bar = BarImpl; + + fn foo() -> Self::Foo { + () + } + + fn bar() -> Self::Bar { + () + } +} + +fn main() {} |