Out Of Bound compile error with .len() function call

I opened a new issue #98444 with the following example code:

fn main() {
    let xs: [i32; 5] = [1, 2, 3, 4, 5];
    let _ = &xs; // this line suppresses the `unconditional_panic` lint
    let _ = xs[7];
}
2 Likes