1 #![feature(generic_const_exprs)]
2 #![allow(incomplete_features, unused)]
4 const fn complex_maths(n : usize) -> usize {
8 pub struct Example<const N: usize> {
10 b: [f32; complex_maths(N)],
11 //~^ ERROR unconstrained generic
14 impl<const N: usize> Example<N> {
15 pub fn new() -> Self {
18 b: [0.; complex_maths(N)],
24 pub fn sum(&self) -> f32 {
25 self.a.iter().sum::<f32>() + self.b.iter().sum::<f32>()