]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/hr-associated-type-bound-param-1.rs
Rollup merge of #76468 - SNCPlay42:lifetime-names, r=Mark-Simulacrum
[rust.git] / src / test / ui / associated-types / hr-associated-type-bound-param-1.rs
1 trait Y<'a, T: ?Sized>
2 where
3     T: Y<'a, Self>,
4     for<'b> <Self as Y<'b, T>>::V: Clone,
5     for<'b> <T as Y<'b, Self>>::V: Clone,
6 {
7     type V: ?Sized;
8     fn g(&self, x: &Self::V) {
9         <Self::V>::clone(x);
10     }
11 }
12
13 impl<'a> Y<'a, u8> for u8 {
14     type V = str;
15     //~^ ERROR the trait bound `for<'b> <u8 as Y<'b, u8>>::V: Clone` is not satisfied
16 }
17
18 fn main() {
19     1u8.g("abc");
20 }