]> git.proxmox.com Git - rustc.git/blob - tests/ui/async-await/in-trait/async-example-desugared.rs
fb92ec786746f9cb9ba3c18b0c9a239da183fa1e
[rustc.git] / tests / ui / async-await / in-trait / async-example-desugared.rs
1 // check-pass
2 // edition: 2021
3
4 #![feature(async_fn_in_trait)]
5 #![feature(return_position_impl_trait_in_trait)]
6 #![allow(incomplete_features)]
7
8 use std::future::Future;
9
10 trait MyTrait {
11 async fn foo(&self) -> i32;
12 }
13
14 impl MyTrait for i32 {
15 fn foo(&self) -> impl Future<Output = i32> + '_ {
16 async { *self }
17 }
18 }
19
20 fn main() {}