]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/in-trait/async-example-desugared-boxed.rs
Rollup merge of #104512 - jyn514:download-ci-llvm-default, r=Mark-Simulacrum
[rust.git] / src / test / ui / async-await / in-trait / async-example-desugared-boxed.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 use std::pin::Pin;
10
11 trait MyTrait {
12     async fn foo(&self) -> i32;
13 }
14
15 impl MyTrait for i32 {
16     // This will break once a PR that implements #102745 is merged
17     fn foo(&self) -> Pin<Box<dyn Future<Output = i32> + '_>> {
18         Box::pin(async {
19             *self
20         })
21     }
22 }
23
24 fn main() {}