]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-len-underflow-separate-spans.rs
Rollup merge of #64603 - gilescope:unused-lifetime-warning, r=matthewjasper
[rust.git] / src / test / ui / consts / const-len-underflow-separate-spans.rs
1 // Check that a constant-evaluation underflow highlights the correct
2 // spot (where the underflow occurred), while also providing the
3 // overall context for what caused the evaluation.
4
5 const ONE: usize = 1;
6 const TWO: usize = 2;
7 const LEN: usize = ONE - TWO;
8 //~^ ERROR any use of this value will cause an error
9
10 fn main() {
11     let a: [i8; LEN] = unimplemented!();
12 //~^ ERROR E0080
13 }