2024-02-16 14:02:50 -06:00
|
|
|
//@ edition:2021
|
2024-02-14 17:52:57 -06:00
|
|
|
|
|
|
|
// 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;
|
|
|
|
});
|
|
|
|
}
|