]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-slice-oob.rs
Rollup merge of #64603 - gilescope:unused-lifetime-warning, r=matthewjasper
[rust.git] / src / test / ui / consts / const-slice-oob.rs
1 #[deny(const_err)]
2
3 const FOO: &'static[u32] = &[1, 2, 3];
4 const BAR: u32 = FOO[5];
5 //~^ index out of bounds: the len is 3 but the index is 5
6 //~| ERROR any use of this value will cause an error
7
8 fn main() {
9     let _ = BAR;
10 }