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
With Rust 1.45.2 (d3fb005a3 2020-07-31) attempting to access an array element which is unconditionally out of bounds is caught and reported with a compilation error as oppose to causing a runtime panic as the example suggests.
I get the following output:
Compiling arrays v0.1.0 (file:///projects/arrays)
error: this operation will panic at runtime
--> src/main.rs:5:19
|
5 | let element = a[index];
| ^^^^^^^^ index out of bounds: the len is 5 but the index is 10
|
= note: `#[deny(unconditional_panic)]` on by default
error: aborting due to previous error
The text was updated successfully, but these errors were encountered:
With Rust 1.45.2 (d3fb005a3 2020-07-31) attempting to access an array element which is unconditionally out of bounds is caught and reported with a compilation error as oppose to causing a runtime panic as the example suggests.
I get the following output:
The text was updated successfully, but these errors were encountered: