]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/issue-91560.fixed
Auto merge of #91403 - cjgillot:inherit-async, r=oli-obk
[rust.git] / src / test / 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() {}