]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-89686.rs
Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
[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: the trait bound `T: Trait` is not satisfied
9
10 trait Trait {
11     type F: Future<Output = ()>;
12
13     fn f(&self) -> Self::F;
14
15     fn g<'a>(&'a self) -> G<'a, Self>
16     where
17         Self: Sized,
18     {
19         async move { self.f().await }
20     }
21 }
22
23 fn main() {}