]> git.proxmox.com Git - rustc.git/blame - src/test/ui/type-alias-impl-trait/issue-89952.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / type-alias-impl-trait / issue-89952.rs
CommitLineData
04454e1e
FG
1// check-pass
2
3#![feature(type_alias_impl_trait)]
4
5trait SomeTrait {}
6impl SomeTrait for () {}
7
8trait MyFuture {
9 type Output;
10}
11impl<T> MyFuture for T {
12 type Output = T;
13}
14
15trait ReturnsFuture {
16 type Output: SomeTrait;
17 type Future: MyFuture<Output = Result<Self::Output, ()>>;
18 fn func() -> Self::Future;
19}
20
21struct Foo;
22
23impl 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
31fn main() {}