]> git.lizzy.rs Git - rust.git/blob - src/test/ui/non-constant-expr-for-arr-len.rs
Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26
[rust.git] / src / test / ui / non-constant-expr-for-arr-len.rs
1 // Check that non constant exprs fail for array repeat syntax
2
3 fn main() {
4     fn bar(n: usize) {
5         let _x = [0; n];
6         //~^ ERROR attempt to use a non-constant value in a constant [E0435]
7     }
8 }