summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/new-solver/async.rs
blob: 155b71eb749914d06dc514fb428877fcf982fdeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// compile-flags: -Ztrait-solver=next
// edition: 2021
// revisions: pass fail
//[pass] check-pass

use std::future::Future;

fn needs_async(_: impl Future<Output = i32>) {}

#[cfg(fail)]
fn main() {
    needs_async(async {});
    //[fail]~^ ERROR type mismatch
}

#[cfg(pass)]
fn main() {
    needs_async(async { 1i32 });
}