1 // compile-flags: -Zmir-opt-level=3
4 #![feature(generic_const_exprs)]
5 //~^ WARN the feature `generic_const_exprs` is incomplete
8 fn from_fn_1<const N: usize, F: FnMut(usize) -> f32>(mut f: F) -> [f32; N] {
9 let mut result = [0.0; N];
18 pub struct TestArray<const N: usize>
25 impl<const N: usize> TestArray<N>
29 fn from_fn_2<F: FnMut(usize) -> f32>(f: F) -> Self {
30 Self { array: from_fn_1(f) }
35 TestArray::<4>::from_fn_2(|i| 0.0);