You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fnbar(a:&mut[usize;5]){
a[5] = 7;}pubfnmain(){letmut 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