mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
21 lines
404 B
Rust
21 lines
404 B
Rust
//@ aux-build:block-on.rs
|
|
//@ edition:2021
|
|
//@ build-pass
|
|
|
|
#![feature(async_closure)]
|
|
|
|
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: async FnOnce()>(f: F) {
|
|
f().await;
|
|
}
|
|
|
|
fn main() {
|
|
block_on::block_on(call_once(async || empty().await));
|
|
}
|