]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-len-underflow-subspans.rs
Do not suggest `let_else` if no bindings would be introduced
[rust.git] / src / test / ui / consts / const-len-underflow-subspans.rs
1 // Check that a constant-evaluation underflow highlights the correct
2 // spot (where the underflow occurred).
3
4 const ONE: usize = 1;
5 const TWO: usize = 2;
6
7 fn main() {
8     let a: [i8; ONE - TWO] = unimplemented!();
9     //~^ ERROR evaluation of constant value failed
10     //~| attempt to compute `1_usize - 2_usize`, which would overflow
11 }