fix unconditional_panic warning

This commit is contained in:
Jorge Aparicio 2020-07-16 16:21:49 +02:00
parent 0e3051f4c3
commit 91edd1d679

View file

@ -24,9 +24,13 @@ fn foo() {
#[inline(never)]
fn bar() {
let i = 3;
let i = index();
let array = [0, 1, 2];
let x = array[i]; // out of bounds access
log::info!("{}", x);
}
fn index() -> usize {
3
}