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), while also providing the
|
|
|
|
// overall context for what caused the evaluation.
|
|
|
|
|
2023-07-04 08:40:15 -05:00
|
|
|
// revisions: old next
|
|
|
|
//[next] compile-flags: -Ztrait-solver=next
|
|
|
|
|
2015-02-27 10:24:22 -06:00
|
|
|
const ONE: usize = 1;
|
|
|
|
const TWO: usize = 2;
|
|
|
|
const LEN: usize = ONE - TWO;
|
2022-09-21 06:05:20 -05:00
|
|
|
//~^ ERROR constant
|
2015-02-27 10:24:22 -06:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let a: [i8; LEN] = unimplemented!();
|
2022-11-15 05:06:20 -06:00
|
|
|
//~^ constant
|
2015-02-27 10:24:22 -06:00
|
|
|
}
|