-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
As a user of ndarray, I can use negative indexing in slices, like I would do with NumPy
// A view of the image without borders
let block = image.slice(s![1..-1, 1..-1, 1..-1]);
Since Rust 1.45.0, I get this error when I run clippy: error: this range is empty so it will yield no values
. This message is wrong: my code compiles and runs as intended. Clippy shouldn't only check if end <= start
, it should also check if end
is negative, or if it's a isize
slice.
bluss, hombit, Bergschrat1 and ModProg
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