]> git.lizzy.rs Git - rust.git/blob - tests/ui/closures/2229_closure_analysis/migrations/issue-86753.rs
Rollup merge of #107248 - erikdesjardins:addrspace, r=oli-obk
[rust.git] / tests / ui / closures / 2229_closure_analysis / migrations / issue-86753.rs
1 // edition:2018
2 // check-pass
3
4 #![warn(rust_2021_compatibility)]
5
6 use std::future::Future;
7
8 struct Runtime;
9
10 impl Runtime {
11     pub fn block_on<F: Future>(&self, _future: F) -> F::Output {
12         unimplemented!()
13     }
14 }
15
16 pub fn http<F, Fut>(_func: F)
17 where
18     F: Fn() -> Fut,
19     Fut: Future<Output = ()>,
20 {
21     let rt = Runtime {};
22     let srv = rt.block_on(async move { serve(move || async move { unimplemented!() }) });
23     let _ = || rt.block_on(async { srv });
24 }
25
26 pub struct Server<S> {
27     _marker: std::marker::PhantomData<S>,
28 }
29
30 pub fn serve<S>(_new_service: S) -> Server<S> {
31     unimplemented!()
32 }
33
34 fn main() { }