2024-02-16 20:02:50 +00:00
|
|
|
//@ edition:2021
|
|
|
|
|
//@ run-rustfix
|
2022-06-03 18:40:39 -07:00
|
|
|
|
|
|
|
|
#![allow(unused)]
|
|
|
|
|
|
|
|
|
|
use std::future::Future;
|
|
|
|
|
|
|
|
|
|
async fn foo() -> Result<(), i32> {
|
|
|
|
|
func(async { Ok::<_, i32>(()) })?;
|
|
|
|
|
//~^ 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() {}
|