about summary refs log tree commit diff
path: root/tests/ui/async-await/async-closures/body-check-on-non-fnmut.rs
blob: 0560d3b0867cf936efb2d0deea494164e93c7ef4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//@ aux-build:block-on.rs
//@ edition:2021
//@ build-pass

extern crate block_on;

// Make sure that we don't call `coroutine_by_move_body_def_id` query
// on async closures that are `FnOnce`. See issue: #130167.

async fn empty() {}

pub async fn call_once<F: AsyncFnOnce()>(f: F) {
    f().await;
}

fn main() {
    block_on::block_on(call_once(async || empty().await));
}