summary refs log tree commit diff
path: root/tests/ui/async-await/async-closures/not-fn.rs
blob: 5322a6d5d7ad33661a08860d5b27d034b07802d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ 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;
    });
}