From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../check-trait-object-bounds-6.rs | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/ui/traits/associated_type_bound/check-trait-object-bounds-6.rs (limited to 'tests/ui/traits/associated_type_bound/check-trait-object-bounds-6.rs') diff --git a/tests/ui/traits/associated_type_bound/check-trait-object-bounds-6.rs b/tests/ui/traits/associated_type_bound/check-trait-object-bounds-6.rs new file mode 100644 index 000000000..cb196d67f --- /dev/null +++ b/tests/ui/traits/associated_type_bound/check-trait-object-bounds-6.rs @@ -0,0 +1,24 @@ +// Check that we validate associated type bounds on super traits for trait +// objects + +trait Is { + type T; +} + +impl Is for U { + type T = U; +} + +trait Obj { + type U: Is; + type V; +} + +fn is_obj(_: &T) {} + +fn f(x: &dyn Obj) { + is_obj(x) + //~^ ERROR type mismatch resolving `::T == i64` +} + +fn main() {} -- cgit v1.2.3