rust/src/test/ui/consts/const-len-underflow-separate-spans.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
465 B
Rust
Raw Normal View History

// Check that a constant-evaluation underflow highlights the correct
// 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;
//~^ 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
fn main() {
let a: [i8; LEN] = unimplemented!();
2018-01-16 08:24:38 +00:00
//~^ ERROR E0080
}