]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-consts/mismatched_impl_ty_1.rs
Rollup merge of #105674 - estebank:iterator-chains, r=oli-obk
[rust.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 }