about summary refs log tree commit diff
path: root/tests/ui/async-await/async-closures/not-fn.rs
blob: 34dd2a22bbb96e5d74b142a92c7b60b76033efcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//@ edition:2021

// FIXME(async_closures): This needs a better error message!

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;
    });
}