2022-10-07 11:15:13 -05:00
|
|
|
// check-pass
|
|
|
|
// edition: 2021
|
|
|
|
|
|
|
|
#![feature(async_fn_in_trait)]
|
|
|
|
#![feature(return_position_impl_trait_in_trait)]
|
|
|
|
#![allow(incomplete_features)]
|
|
|
|
|
|
|
|
use std::future::Future;
|
|
|
|
|
|
|
|
trait MyTrait {
|
|
|
|
async fn foo(&self) -> i32;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl MyTrait for i32 {
|
2023-09-01 23:02:11 -05:00
|
|
|
fn foo(&self) -> impl Future<Output = i32> {
|
2022-11-02 19:45:08 -05:00
|
|
|
async { *self }
|
2022-10-07 11:15:13 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|