]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-89686.rs
Rollup merge of #92715 - chordtoll:empty-string, r=davidtwco
[rust.git] / src / test / ui / type-alias-impl-trait / issue-89686.rs
1 // edition:2018
2
3 #![feature(type_alias_impl_trait)]
4
5 use std::future::Future;
6
7 type G<'a, T> = impl Future<Output = ()>;
8 //~^ ERROR: type mismatch resolving `<impl Future<Output = [async output]> as Future>::Output == ()`
9 //~| ERROR: the trait bound `T: Trait` is not satisfied
10
11 trait Trait {
12     type F: Future<Output = ()>;
13
14     fn f(&self) -> Self::F;
15
16     fn g<'a>(&'a self) -> G<'a, Self>
17     where
18         Self: Sized,
19     {
20         async move { self.f().await }
21     }
22 }
23
24 fn main() {}