]> git.lizzy.rs Git - rust.git/blob - tests/ui/generic-associated-types/method-unsatified-assoc-type-predicate.rs
Rollup merge of #103702 - WaffleLapkin:lift-sized-bounds-from-pointer-methods-where...
[rust.git] / tests / ui / generic-associated-types / method-unsatified-assoc-type-predicate.rs
1 // Test that the predicate printed in an unresolved method error prints the
2 // generics for a generic associated type.
3
4 trait X {
5     type Y<T>;
6 }
7
8 trait M {
9     fn f(&self) {}
10 }
11
12 impl<T: X<Y<i32> = i32>> M for T {}
13 //~^ NOTE trait bound `<S as X>::Y<i32> = i32` was not satisfied
14 //~| NOTE
15 //~| NOTE
16 //~| NOTE
17
18 struct S;
19 //~^ NOTE method `f` not found for this
20 //~| NOTE doesn't satisfy `<S as X>::Y<i32> = i32`
21 //~| NOTE doesn't satisfy `S: M`
22
23 impl X for S {
24     type Y<T> = bool;
25 }
26
27 fn f(a: S) {
28     a.f();
29     //~^ ERROR the method `f` exists for struct `S`, but its trait bounds were not satisfied
30     //~| NOTE method cannot be called on `S` due to unsatisfied trait bounds
31 }
32
33 fn main() {}