]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/async-with-closure.rs
Rollup merge of #60756 - matthewjasper:extra-impl-trait-tests, r=nikomatsakis
[rust.git] / src / test / ui / async-await / async-with-closure.rs
1 // compile-pass
2 // edition:2018
3
4 #![feature(async_await, await_macro)]
5
6 trait MyClosure {
7     type Args;
8 }
9
10 impl<R> MyClosure for dyn FnMut() -> R
11 where R: 'static {
12     type Args = ();
13 }
14
15 struct MyStream<C: ?Sized + MyClosure> {
16     x: C::Args,
17 }
18
19 async fn get_future<C: ?Sized + MyClosure>(_stream: MyStream<C>) {}
20
21 async fn f() {
22     let messages: MyStream<FnMut()> = unimplemented!();
23     await!(get_future(messages));
24 }
25
26 fn main() {}