rust/tests/ui/async-await/async-closures/wrong-fn-kind.rs

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

17 lines
427 B
Rust
Raw Normal View History

2024-01-25 17:43:35 +00:00
// edition:2021
// FIXME(async_closures): This needs a better error message!
#![feature(async_closure)]
2024-01-25 17:43:35 +00:00
fn main() {
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>
// FIXME: Should say "closure is `async FnMut` but it needs `async Fn`" or sth.
2024-01-25 17:43:35 +00:00
x += 1;
});
}