2015-10-07 17:11:25 -05:00
|
|
|
// Check that a constant-evaluation underflow highlights the correct
|
2015-02-27 10:24:22 -06:00
|
|
|
// spot (where the underflow occurred).
|
|
|
|
|
|
|
|
const ONE: usize = 1;
|
|
|
|
const TWO: usize = 2;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let a: [i8; ONE - TWO] = unimplemented!();
|
2018-08-26 08:19:34 -05:00
|
|
|
//~^ ERROR evaluation of constant value failed
|
2020-09-15 14:34:50 -05:00
|
|
|
//~| attempt to compute `1_usize - 2_usize`, which would overflow
|
2015-02-27 10:24:22 -06:00
|
|
|
}
|