]> git.lizzy.rs Git - rust.git/blob - src/test/ui/non-constant-expr-for-arr-len.rs
Merge commit '2bb3996244cf1b89878da9e39841e9f6bf061602' into sync_cg_clif-2022-12-14
[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 }