]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/const-types.rs
Auto merge of #79342 - CDirkx:ipaddr-const, r=oli-obk
[rust.git] / src / test / ui / const-generics / const-types.rs
1 // Check that arrays can be used with generic const and type.
2 // run-pass
3 // revisions: full min
4
5 #![cfg_attr(full, feature(const_generics))]
6 #![cfg_attr(full, allow(incomplete_features))]
7 #![cfg_attr(min, feature(min_const_generics))]
8
9 #![allow(dead_code, unused_variables)]
10
11 struct ConstArray<T, const LEN: usize> {
12     array: [T; LEN],
13 }
14
15 fn main() {
16     let arr = ConstArray::<i32, 8> {
17         array: [0; 8],
18     };
19 }