]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.rs
Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
[rust.git] / src / test / 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 #![feature(generic_associated_types)]
5
6 trait X {
7     type Y<T>;
8 }
9
10 trait M {
11     fn f(&self) {}
12 }
13
14 impl<T: X<Y<i32> = i32>> M for T {}
15 //~^ NOTE trait bound `<S as X>::Y<i32> = i32` was not satisfied
16 //~| NOTE unsatisfied trait bound introduced here
17 //~| NOTE
18 //~| NOTE
19
20 struct S;
21 //~^ NOTE method `f` not found for this
22 //~| NOTE doesn't satisfy `<S as X>::Y<i32> = i32`
23 //~| NOTE doesn't satisfy `S: M`
24
25 impl X for S {
26     type Y<T> = bool;
27 }
28
29 fn f(a: S) {
30     a.f();
31     //~^ ERROR the method `f` exists for struct `S`, but its trait bounds were not satisfied
32     //~| NOTE method cannot be called on `S` due to unsatisfied trait bounds
33 }
34
35 fn main() {}