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.
|
|
|
|
|
|
|
|
const ONE: usize = 1;
|
|
|
|
const TWO: usize = 2;
|
|
|
|
const LEN: usize = ONE - TWO;
|
2018-08-26 13:19:34 +00:00
|
|
|
//~^ ERROR any use of this value will cause an error
|
2021-01-30 13:49:22 +00:00
|
|
|
//~| WARN this was previously accepted by the compiler but is being phased out
|
2015-02-27 16:24:22 +00:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let a: [i8; LEN] = unimplemented!();
|
2018-01-16 08:24:38 +00:00
|
|
|
//~^ ERROR E0080
|
2015-02-27 16:24:22 +00:00
|
|
|
}
|