]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/in-trait/async-example-desugared.rs
Rollup merge of #103681 - RalfJung:libtest-thread, r=thomcc
[rust.git] / src / test / 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     // This will break once a PR that implements #102745 is merged
16     fn foo(&self) -> impl Future<Output = i32> + '_ {
17         async {
18             *self
19         }
20     }
21 }
22
23 fn main() {}