blob: 993f83784393f400f9756346336511b7762c58de (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
//@ edition: 2021
//@ build-pass
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
fn constrain<T: AsyncFnOnce()>(t: T) -> T {
t
}
fn call_once<T>(f: impl FnOnce() -> T) -> T {
f()
}
async fn async_call_once<T>(f: impl AsyncFnOnce() -> T) -> T {
f().await
}
fn main() {
let c = constrain(async || {});
call_once(c);
let c = constrain(async || {});
async_call_once(c);
}
|