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