]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/issue-91560.fixed
Rollup merge of #106927 - Ezrashaw:e0606-make-machine-applicable, r=estebank
[rust.git] / tests / ui / consts / issue-91560.fixed
1 // Regression test for issue #91560.
2
3 // run-rustfix
4
5 #![allow(unused,non_upper_case_globals)]
6
7 fn 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
14 fn 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
21 fn main() {}