rust/clippy_utils
bors 967f172e25 Auto merge of #9635 - smoelius:fix-9386-bug, r=Jarcho
Fix bug introduced by #9386

#9386 introduced a potential out-of-bounds array access. Specifically, a location returned by `local_assignments` could have  [`location.statement_index` equal to `mir.basic_blocks[location.block].statements.len()`](b8a9a507bf/clippy_utils/src/mir/mod.rs (L129)), in which case the location would refer to the block terminator:
b8a9a507bf/clippy_lints/src/dereference.rs (L1204-L1206)
I suspect the bug is not triggerable now, because of checks leading up to where it occurs. But a future code change could make it triggerable. Hence, it should be fixed.

r? `@Jarcho`

changelog: none
2022-10-20 15:18:31 +00:00
..
src Auto merge of #9635 - smoelius:fix-9386-bug, r=Jarcho 2022-10-20 15:18:31 +00:00
Cargo.toml Merge commit 'ac0e10aa68325235069a842f47499852b2dee79e' into clippyup 2022-10-06 09:44:38 +02:00