summaryrefslogtreecommitdiffstats
path: root/tests/ui/lint/unconditional_panic_98444.rs
blob: 011fabfbbe94c90186cecddd5fda8b652cb7d5f1 (plain)
1
2
3
4
5
6
7
// 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]
}