]> git.proxmox.com Git - rustc.git/blame - src/test/ui/const-generics/issues/issue-67185-2.rs
New upstream version 1.51.0+dfsg1
[rustc.git] / src / test / ui / const-generics / issues / issue-67185-2.rs
CommitLineData
1b1a35ee
XL
1// revisions: full min
2#![cfg_attr(full, feature(const_generics))]
3#![cfg_attr(full, allow(incomplete_features))]
f9f354fc
XL
4
5trait Baz {
6 type Quaks;
7}
8impl Baz for u8 {
9 type Quaks = [u16; 3];
10}
11
12trait Bar {}
13impl Bar for [u16; 4] {}
14impl Bar for [[u16; 3]; 3] {}
15
16trait Foo //~ ERROR the trait bound `[u16; 3]: Bar` is not satisfied [E0277]
17 //~^ ERROR the trait bound `[[u16; 3]; 2]: Bar` is not satisfied [E0277]
18 where
19 [<u8 as Baz>::Quaks; 2]: Bar,
20 <u8 as Baz>::Quaks: Bar,
21{
22}
23
24struct FooImpl;
25
26impl Foo for FooImpl {}
27//~^ ERROR the trait bound `[u16; 3]: Bar` is not satisfied [E0277]
28//~^^ ERROR the trait bound `[[u16; 3]; 2]: Bar` is not satisfied [E0277]
29
30fn f(_: impl Foo) {}
31//~^ ERROR the trait bound `[u16; 3]: Bar` is not satisfied [E0277]
32//~^^ ERROR the trait bound `[[u16; 3]; 2]: Bar` is not satisfied [E0277]
33
34fn main() {
35 f(FooImpl)
36}