]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-69683.rs
New upstream version 1.60.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-69683.rs
CommitLineData
ba9703b0
XL
1pub trait Element<S> {
2 type Array;
3}
4
5impl<T> Element<()> for T {
6 type Array = T;
7}
8
9impl<T: Element<S>, S> Element<[S; 3]> for T {
10 type Array = [T::Array; 3];
11}
12
13trait Foo<I>
14where
15 u8: Element<I>,
16{
17 fn foo(self, x: <u8 as Element<I>>::Array);
18}
19
20impl<I> Foo<I> for u16
21where
22 u8: Element<I>,
23{
24 fn foo(self, _: <u8 as Element<I>>::Array) {}
25}
26
27fn main() {
28 let b: [u8; 3] = [0u8; 3];
29
30 0u16.foo(b); //~ ERROR type annotations needed
3c0e092e 31 //~^ ERROR type annotations needed
ba9703b0
XL
32 //<u16 as Foo<[(); 3]>>::foo(0u16, b);
33}