-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
indexing_slicing ignores match for length #17399
Copy link
Copy link
Open
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have
Description
Activity
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have
Summary
lint ignores context of
match slice.len(). Sister of #17398, reported one per lint.Lint Name
indexing_slicing
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
as `usize is not negative and value 0 was explicitly checked, lint should never fire.
Version
Additional Labels
No response