2024-01-25 17:43:35 +00:00
|
|
|
// edition:2021
|
|
|
|
|
|
|
|
// FIXME(async_closures): This needs a better error message!
|
|
|
|
|
2024-02-06 17:41:48 +00:00
|
|
|
#![feature(async_closure)]
|
2024-01-25 17:43:35 +00:00
|
|
|
|
|
|
|
fn main() {
|
2024-02-06 17:41:48 +00:00
|
|
|
fn needs_async_fn(_: impl async Fn()) {}
|
2024-01-25 17:43:35 +00:00
|
|
|
|
|
|
|
let mut x = 1;
|
|
|
|
needs_async_fn(async || {
|
|
|
|
//~^ ERROR i16: ops::async_function::internal_implementation_detail::AsyncFnKindHelper<i8>
|
2024-02-06 17:41:48 +00:00
|
|
|
// FIXME: Should say "closure is `async FnMut` but it needs `async Fn`" or sth.
|
2024-01-25 17:43:35 +00:00
|
|
|
x += 1;
|
|
|
|
});
|
|
|
|
}
|