rust/tests/ui/non-constant-expr-for-arr-len.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

9 lines
208 B
Rust
Raw Normal View History

2017-06-22 19:13:09 +00:00
// Check that non constant exprs fail for array repeat syntax
fn main() {
fn bar(n: usize) {
let _x = [0; n];
//~^ ERROR attempt to use a non-constant value in a constant [E0435]
}
}