Merge pull request #72 from ferrous-systems/fix-warning

fix unconditional_panic warning
This commit is contained in:
Jorge Aparicio 2020-07-16 14:28:38 +00:00 committed by GitHub
commit 6eb4ed8fa6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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
}