]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-89952.rs
Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
[rust.git] / src / test / ui / type-alias-impl-trait / issue-89952.rs
1 // check-pass
2
3 #![feature(type_alias_impl_trait)]
4
5 trait SomeTrait {}
6 impl SomeTrait for () {}
7
8 trait MyFuture {
9     type Output;
10 }
11 impl<T> MyFuture for T {
12     type Output = T;
13 }
14
15 trait ReturnsFuture {
16     type Output: SomeTrait;
17     type Future: MyFuture<Output = Result<Self::Output, ()>>;
18     fn func() -> Self::Future;
19 }
20
21 struct Foo;
22
23 impl ReturnsFuture for Foo {
24     type Output = impl SomeTrait;
25     type Future = impl MyFuture<Output = Result<Self::Output, ()>>;
26     fn func() -> Self::Future {
27         Result::<(), ()>::Err(())
28     }
29 }
30
31 fn main() {}