]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-len-underflow-subspans.rs
Rollup merge of #64603 - gilescope:unused-lifetime-warning, r=matthewjasper
[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 subtract with overflow
11 }