Open
Description
What it does
Check for code like
fn a(v1: Vec<_>, v2: Vec<_>, x: usize) {
if v1[x] == v2[x] &&
v1.len() == v2.len() {}
}
The length-check is probably intended to guard against index-out-of-bounds access however it was (most likely mistakenly) placed AFTER the access by index. It should be at the front.
Categories (optional)
- Kind: correctness