granite-rust/tests/ui/async-await/async-closures/body-check-on-non-fnmut.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
375 B
Rust
Raw Normal View History

//@ 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() {}
2024-11-04 18:59:57 +00:00
pub async fn call_once<F: AsyncFnOnce()>(f: F) {
f().await;
}
fn main() {
block_on::block_on(call_once(async || empty().await));
}