]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/async-with-closure.rs
Rollup merge of #106854 - steffahn:drop_linear_arc_rebased, r=Mark-Simulacrum
[rust.git] / tests / 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() {}