blob: c42bdfff5f9e6723a2ba4d3a569bf861fb1cd11b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// edition:2021
// run-rustfix
#![allow(unused)]
use std::future::Future;
async fn foo() -> Result<(), i32> {
func(async { Ok::<_, i32>(()) }).await?;
//~^ ERROR the `?` operator can only be applied to values that implement `Try`
Ok(())
}
async fn func<T>(fut: impl Future<Output = T>) -> T {
fut.await
}
fn main() {}
|