about summary refs log tree commit diff
path: root/tests/ui/async-await/async-closures/kind-due-to-rpit.rs
blob: ad19d93b93a3c525348558b74340d0ab711d5562 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//@ edition: 2024

// Make sure the error message is understandable when an `AsyncFn` goal is not satisfied
// (due to closure kind), and that goal originates from an RPIT.

fn repro(foo: impl Into<bool>) -> impl AsyncFn() {
    let inner_fn = async move || {
        //~^ ERROR expected a closure that implements the `AsyncFn` trait
        let _ = foo.into();
    };
    inner_fn
}

fn main() {}