rust/tests/ui/async-await/async-closures/not-fn.rs
2024-11-02 03:33:31 +00:00

16 lines
341 B
Rust

//@ edition:2021
// FIXME(async_closures): This needs a better error message!
#![feature(async_closure)]
fn main() {
fn needs_fn<T>(_: impl FnMut() -> T) {}
let mut x = 1;
needs_fn(async || {
//~^ ERROR async closure does not implement `FnMut` because it captures state from its environment
x += 1;
});
}