]> git.lizzy.rs Git - rust.git/blob - src/test/ui/object-safety/issue-102933.rs
Auto merge of #97870 - eggyal:inplace_fold_spec, r=wesleywiser
[rust.git] / src / test / ui / object-safety / issue-102933.rs
1 // check-pass
2
3 use std::future::Future;
4
5 pub trait Service {
6     type Response;
7     type Future: Future<Output = Self::Response>;
8 }
9
10 pub trait A1: Service<Response = i32> {}
11
12 pub trait A2: Service<Future = Box<dyn Future<Output = i32>>> + A1 {
13     fn foo(&self) {}
14 }
15
16 pub trait B1: Service<Future = Box<dyn Future<Output = i32>>> {}
17
18 pub trait B2: Service<Response = i32> + B1 {
19     fn foo(&self) {}
20 }
21
22 fn main() {
23     let x: &dyn A2 = todo!();
24     let x: &dyn B2 = todo!();
25 }