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