missing_asserts_for_indexing is emitted when length is checked with "==" (instead of ">") #11835
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Summary
The suggestion for lint missing_asserts_for_indexing (
assert!(foobar.len() > 42);
) works fine to disable the lint. However, sometimes, it makes more sense to check the length with equality (assert!(foobar.len() == 43);
). I'd expect this to disable the lint as well but it does not seem to be the case.Lint Name
missing_asserts_for_indexing
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen: no error.
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: