2015-10-07 23:11:25 +01:00
|
|
|
// Check that a constant-evaluation underflow highlights the correct
|
2015-02-27 17:24:22 +01:00
|
|
|
// spot (where the underflow occurred), while also providing the
|
|
|
|
// overall context for what caused the evaluation.
|
|
|
|
|
|
|
|
const ONE: usize = 1;
|
|
|
|
const TWO: usize = 2;
|
|
|
|
const LEN: usize = ONE - TWO;
|
2022-09-21 13:05:20 +02:00
|
|
|
//~^ ERROR constant
|
2015-02-27 17:24:22 +01:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let a: [i8; LEN] = unimplemented!();
|
2022-11-15 12:06:20 +01:00
|
|
|
//~^ constant
|
2015-02-27 17:24:22 +01:00
|
|
|
}
|