mirror of
https://github.com/ferrous-systems/embedded-trainings-2020.git
synced 2025-02-10 22:52:21 +00:00
fix unconditional_panic warning
This commit is contained in:
parent
0e3051f4c3
commit
91edd1d679
1 changed files with 5 additions and 1 deletions
|
@ -24,9 +24,13 @@ fn foo() {
|
||||||
|
|
||||||
#[inline(never)]
|
#[inline(never)]
|
||||||
fn bar() {
|
fn bar() {
|
||||||
let i = 3;
|
let i = index();
|
||||||
let array = [0, 1, 2];
|
let array = [0, 1, 2];
|
||||||
let x = array[i]; // out of bounds access
|
let x = array[i]; // out of bounds access
|
||||||
|
|
||||||
log::info!("{}", x);
|
log::info!("{}", x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn index() -> usize {
|
||||||
|
3
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue