fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1// Regression test for issue #91560. 2 3// run-rustfix 4 5#![allow(unused,non_upper_case_globals)] 6 7fn foo() { 8 const length: usize = 2; 9 //~^ HELP: consider using `const` 10 let arr = [0; length]; 11 //~^ ERROR: attempt to use a non-constant value in a constant [E0435] 12} 13 14fn bar() { 15 const length: usize = 2; 16 //~^ HELP: consider using `const` 17 let arr = [0; length]; 18 //~^ ERROR: attempt to use a non-constant value in a constant [E0435] 19} 20 21fn main() {}