rust/tests/ui/async-await/async-closures/is-not-fn.rs
2024-12-13 00:04:56 +00:00

8 lines
190 B
Rust

//@ edition:2021
fn main() {
fn needs_fn(x: impl FnOnce()) {}
needs_fn(async || {});
//~^ ERROR expected `{async closure@is-not-fn.rs:5:14}` to be a closure that returns `()`
}