]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-slice-oob.rs
Do not suggest `let_else` if no bindings would be introduced
[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 length is 3 but the index is 5
6 //~| ERROR any use of this value will cause an error
7 //~| WARN this was previously accepted by the compiler but is being phased out
8
9 fn main() {
10     let _ = BAR;
11 }