mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
20 lines
340 B
Rust
20 lines
340 B
Rust
|
// 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() {}
|