]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/hr-associated-type-bound-2.rs
Rollup merge of #76468 - SNCPlay42:lifetime-names, r=Mark-Simulacrum
[rust.git] / src / test / ui / associated-types / hr-associated-type-bound-2.rs
1 trait X<'a>
2 where
3     for<'b> <Self as X<'b>>::U: Clone,
4 {
5     type U: ?Sized;
6     fn f(&self, x: &Self::U) {
7         <Self::U>::clone(x);
8     }
9 }
10
11 impl X<'_> for u32
12 where
13     for<'b> <Self as X<'b>>::U: Clone,
14 {
15     type U = str;
16 }
17
18 fn main() {
19     1u32.f("abc");
20     //~^ ERROR no method named `f` found for type `u32` in the current scope
21 }