-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False positive in reversed_empty_ranges used with Vec::splice #5689
Comments
Hey @dtolnay, thanks for opening the issue. So, this is the second issue (the other one being #5628) related to The original spirit of the lint was to avoid confusion when the developer uses inverted bounds, both the result of the range being empty and a runtime panic in case of indexing a slice. I would be now in favor of not linting |
…or` loop. Reading the documentation for the lint, one could expect that the lint works in all cases that `X == Y`. This is false. While the lint was updated, the documentation wasn't. More information about the `N..N` problem in rust-lang#5689 and rust-lang#5628
[#10167] Clarify that the lint only works if x eq. y in a `for` loop. Reading the documentation for the lint, one could expect that the lint works in all cases that `X == Y`. This is false. While the lint was updated, the documentation wasn't. More information about the `N..N` problem in #5689 and #5628 --- Fixes #10167 changelog: [`reversed_empty_ranges`]: Update and clarify documentation
…or` loop. Reading the documentation for the lint, one could expect that the lint works in all cases that `X == Y`. This is false. While the lint was updated, the documentation wasn't. More information about the `N..N` problem in rust-lang#5689 and rust-lang#5628
I believe this is a correct use of an empty range.
https://doc.rust-lang.org/std/vec/struct.Vec.html#method.splice
Mentioning @ebroto @yaahc who touched this lint recently in #5583.
clippy 0.0.212 (826cb06 2020-06-05)
The text was updated successfully, but these errors were encountered: