]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.rs
Rollup merge of #105343 - nbdd0121:hir, r=fee1-dead
[rust.git] / src / test / ui / async-await / in-trait / async-example-desugared-boxed-in-trait.rs
1 // edition: 2021
2
3 #![feature(async_fn_in_trait)]
4 #![feature(return_position_impl_trait_in_trait)]
5 #![allow(incomplete_features)]
6
7 use std::future::Future;
8 use std::pin::Pin;
9
10 trait MyTrait {
11     fn foo(&self) -> Pin<Box<dyn Future<Output = i32> + '_>>;
12 }
13
14 impl MyTrait for i32 {
15     async fn foo(&self) -> i32 {
16         //~^ ERROR method `foo` has an incompatible type for trait
17         *self
18     }
19 }
20
21 fn main() {}