2024-02-16 20:02:50 +00:00
|
|
|
//@ check-pass
|
|
|
|
//@ edition: 2021
|
2022-10-07 16:15:13 +00:00
|
|
|
|
|
|
|
use std::future::Future;
|
|
|
|
|
|
|
|
trait MyTrait {
|
2023-09-26 20:20:25 +00:00
|
|
|
#[allow(async_fn_in_trait)]
|
2022-10-07 16:15:13 +00:00
|
|
|
async fn foo(&self) -> i32;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl MyTrait for i32 {
|
2023-09-02 04:02:11 +00:00
|
|
|
fn foo(&self) -> impl Future<Output = i32> {
|
2022-11-02 17:45:08 -07:00
|
|
|
async { *self }
|
2022-10-07 16:15:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|