]> git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/const-len-underflow-subspans.rs
New upstream version 1.46.0~beta.2+dfsg1
[rustc.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 }