mirror of
https://github.com/ferrous-systems/embedded-trainings-2020.git
synced 2025-01-09 07:45:34 +00:00
Merge pull request #72 from ferrous-systems/fix-warning
fix unconditional_panic warning
This commit is contained in:
commit
6eb4ed8fa6
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue