rust/tests/ui/traits/new-solver/async.rs
2023-01-26 03:15:36 +00:00

20 lines
374 B
Rust

// 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 to be a future that resolves to `i32`, but it resolves to `()`
}
#[cfg(pass)]
fn main() {
needs_async(async { 1i32 });
}