]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/async-with-closure.rs
Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26
[rust.git] / src / test / ui / async-await / async-with-closure.rs
1 // build-pass (FIXME(62277): could be check-pass?)
2 // edition:2018
3
4 trait MyClosure {
5     type Args;
6 }
7
8 impl<R> MyClosure for dyn FnMut() -> R
9 where R: 'static {
10     type Args = ();
11 }
12
13 struct MyStream<C: ?Sized + MyClosure> {
14     x: C::Args,
15 }
16
17 async fn get_future<C: ?Sized + MyClosure>(_stream: MyStream<C>) {}
18
19 async fn f() {
20     let messages: MyStream<dyn FnMut()> = unimplemented!();
21     get_future(messages).await;
22 }
23
24 fn main() {}