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