rust/tests/ui/lint/unconditional_panic_98444.rs

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

8 lines
176 B
Rust
Raw Normal View History

2023-03-06 13:41:07 +00:00
//@ build-fail
fn main() {
let xs: [i32; 5] = [1, 2, 3, 4, 5];
let _ = &xs;
let _ = xs[7]; //~ ERROR: this operation will panic at runtime [unconditional_panic]
}