]> git.lizzy.rs Git - rust.git/blob - src/test/ui/array-slice-vec/array_const_index-1.rs
Rollup merge of #99064 - lyming2007:issue-97687-fix, r=estebank
[rust.git] / src / test / ui / array-slice-vec / array_const_index-1.rs
1 const A: [i32; 0] = [];
2 const B: i32 = A[1];
3 //~^ index out of bounds: the length is 0 but the index is 1
4 //~| ERROR any use of this value will cause an error
5 //~| WARN this was previously accepted by the compiler but is being phased out
6
7 fn main() {
8     let _ = B;
9 }