]> git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/const-len-underflow-separate-spans.rs
New upstream version 1.51.0+dfsg1
[rustc.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 //~| WARN this was previously accepted by the compiler but is being phased out
10
11 fn main() {
12 let a: [i8; LEN] = unimplemented!();
13 //~^ ERROR E0080
14 }