From 4f9fe856a25ab29345b90e7725509e9ee38a37be Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:41 +0200 Subject: Adding upstream version 1.69.0+dfsg1. Signed-off-by: Daniel Baumann --- .../method-unsatisfied-assoc-type-predicate.rs | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/ui/generic-associated-types/method-unsatisfied-assoc-type-predicate.rs (limited to 'tests/ui/generic-associated-types/method-unsatisfied-assoc-type-predicate.rs') diff --git a/tests/ui/generic-associated-types/method-unsatisfied-assoc-type-predicate.rs b/tests/ui/generic-associated-types/method-unsatisfied-assoc-type-predicate.rs new file mode 100644 index 000000000..83655341d --- /dev/null +++ b/tests/ui/generic-associated-types/method-unsatisfied-assoc-type-predicate.rs @@ -0,0 +1,33 @@ +// Test that the predicate printed in an unresolved method error prints the +// generics for a generic associated type. + +trait X { + type Y; +} + +trait M { + fn f(&self) {} +} + +impl = i32>> M for T {} +//~^ NOTE trait bound `::Y = i32` was not satisfied +//~| NOTE +//~| NOTE +//~| NOTE + +struct S; +//~^ NOTE method `f` not found for this +//~| NOTE doesn't satisfy `::Y = i32` +//~| NOTE doesn't satisfy `S: M` + +impl X for S { + type Y = bool; +} + +fn f(a: S) { + a.f(); + //~^ ERROR the method `f` exists for struct `S`, but its trait bounds were not satisfied + //~| NOTE method cannot be called on `S` due to unsatisfied trait bounds +} + +fn main() {} -- cgit v1.2.3