]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/min_const_generics/generic-function-call-in-array-length.rs
f5387d659b3faf292a47ddcda48d7f5fab5ee8f0
[rust.git] / src / test / ui / const-generics / min_const_generics / generic-function-call-in-array-length.rs
1 #![feature(min_const_generics)]
2
3 const fn foo(n: usize) -> usize { n * 2 }
4
5 fn bar<const N: usize>() -> [u32; foo(N)] {
6     //~^ ERROR generic parameters must not be used inside of non-trivial constant values
7     [0; foo(N)]
8     //~^ ERROR generic parameters must not be used inside of non-trivial constant values
9 }
10
11 fn main() {}