]> git.lizzy.rs Git - rust.git/blob - tests/ui/trait-bounds/issue-94999.rs
Rollup merge of #106664 - chenyukang:yukang/fix-106597-remove-lseek, r=cuviper
[rust.git] / tests / ui / trait-bounds / issue-94999.rs
1 // check-pass
2
3 trait Identity<Q> {
4     type T;
5 }
6
7 impl<Q, T> Identity<Q> for T {
8     type T = T;
9 }
10
11 trait Holds {
12     type Q;
13 }
14
15 struct S;
16 struct X(S);
17
18 struct XHelper;
19
20 impl Holds for X {
21     type Q = XHelper;
22 }
23
24 impl<Q> Clone for X
25 where
26     <S as Identity<Q>>::T: Clone,
27     X: Holds<Q = Q>,
28 {
29     fn clone(&self) -> Self {
30         Self(self.0.clone())
31     }
32 }
33
34 fn main() {}