Closed as not planned
Closed as not planned
Description
Code
I tried this code:
fn bar(a: &mut [usize; 5]) {
a[5] = 7;
}
pub fn main() {
let mut a = [0usize; 5];
bar(&mut a);
}
I expected to see this happen (as it did with 1.60):
error: this operation will panic at runtime
--> <source>:2:5
|
2 | a[5] = 7;
| ^^^^ index out of bounds: the length is 5 but the index is 5
|
= note: `#[deny(unconditional_panic)]` on by default
Instead, this happened:
Compiles and than fails at runtime
thread 'main' panicked at 'index out of bounds: the len is 5 but the index is 5', /app/example.rs:2:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Version it worked on
It most recently worked on: 1.60
Version with regression
Looks similar to this older bug report: #98444