rust/tests/ui/const-generics/issues/issue-67185-2.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
748 B
Rust
Raw Normal View History

2020-01-03 18:42:02 -06:00
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
[<u8 as Baz>::Quaks; 2]: Bar, //~ ERROR the trait bound `[[u16; 3]; 2]: Bar` is not satisfied [E0277]
<u8 as Baz>::Quaks: Bar, //~ ERROR the trait bound `[u16; 3]: Bar` is not satisfied [E0277]
2020-01-03 18:42:02 -06:00
{
}
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]
2020-01-03 18:42:02 -06:00
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]
2020-01-03 18:42:02 -06:00
fn main() {
f(FooImpl)
}