]> git.proxmox.com Git - rustc.git/blob - src/test/ui/associated-consts/mismatched_impl_ty_1.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / associated-consts / mismatched_impl_ty_1.rs
1 // run-pass
2 #![feature(generic_const_exprs)]
3 #![allow(incomplete_features)]
4
5 trait MyTrait {
6 type ArrayType;
7 const SIZE: usize;
8 const ARRAY: Self::ArrayType;
9 }
10 impl MyTrait for () {
11 type ArrayType = [u8; Self::SIZE];
12 const SIZE: usize = 4;
13 const ARRAY: [u8; Self::SIZE] = [1, 2, 3, 4];
14 }
15
16 fn main() {
17 let _ = <() as MyTrait>::ARRAY;
18 }