From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/const-generics/issues/issue-67185-2.rs | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/ui/const-generics/issues/issue-67185-2.rs (limited to 'tests/ui/const-generics/issues/issue-67185-2.rs') diff --git a/tests/ui/const-generics/issues/issue-67185-2.rs b/tests/ui/const-generics/issues/issue-67185-2.rs new file mode 100644 index 000000000..18bb6f6bc --- /dev/null +++ b/tests/ui/const-generics/issues/issue-67185-2.rs @@ -0,0 +1,31 @@ +trait Baz { + type Quaks; +} +impl Baz for u8 { + type Quaks = [u16; 3]; +} + +trait Bar {} +impl Bar for [u16; 4] {} +impl Bar for [[u16; 3]; 3] {} + +trait Foo +where + [::Quaks; 2]: Bar, //~ ERROR the trait bound `[[u16; 3]; 2]: Bar` is not satisfied [E0277] + ::Quaks: Bar, //~ ERROR the trait bound `[u16; 3]: Bar` is not satisfied [E0277] +{ +} + +struct FooImpl; + +impl Foo for FooImpl {} +//~^ ERROR the trait bound `[u16; 3]: Bar` is not satisfied [E0277] +//~^^ ERROR the trait bound `[[u16; 3]; 2]: Bar` is not satisfied [E0277] + +fn f(_: impl Foo) {} +//~^ ERROR the trait bound `[u16; 3]: Bar` is not satisfied [E0277] +//~^^ ERROR the trait bound `[[u16; 3]; 2]: Bar` is not satisfied [E0277] + +fn main() { + f(FooImpl) +} -- cgit v1.2.3