]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-69683.rs
Merge commit '97e504549371d7640cf011d266e3c17394fdddac' into sync_cg_clif-2021-12-20
[rust.git] / src / test / ui / issues / issue-69683.rs
1 pub trait Element<S> {
2     type Array;
3 }
4
5 impl<T> Element<()> for T {
6     type Array = T;
7 }
8
9 impl<T: Element<S>, S> Element<[S; 3]> for T {
10     type Array = [T::Array; 3];
11 }
12
13 trait Foo<I>
14 where
15     u8: Element<I>,
16 {
17     fn foo(self, x: <u8 as Element<I>>::Array);
18 }
19
20 impl<I> Foo<I> for u16
21 where
22     u8: Element<I>,
23 {
24     fn foo(self, _: <u8 as Element<I>>::Array) {}
25 }
26
27 fn main() {
28     let b: [u8; 3] = [0u8; 3];
29
30     0u16.foo(b); //~ ERROR type annotations needed
31     //~^ ERROR type annotations needed
32     //<u16 as Foo<[(); 3]>>::foo(0u16, b);
33 }