mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
Auto merge of #10168 - blyxyas:fix_reversed_empty_ranges, r=dswij
[#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
This commit is contained in:
commit
19b79c485e
1 changed files with 1 additions and 1 deletions
|
@ -103,7 +103,7 @@ declare_clippy_lint! {
|
||||||
declare_clippy_lint! {
|
declare_clippy_lint! {
|
||||||
/// ### What it does
|
/// ### What it does
|
||||||
/// Checks for range expressions `x..y` where both `x` and `y`
|
/// Checks for range expressions `x..y` where both `x` and `y`
|
||||||
/// are constant and `x` is greater or equal to `y`.
|
/// are constant and `x` is greater to `y`. Also triggers if `x` is equal to `y` when they are conditions to a `for` loop.
|
||||||
///
|
///
|
||||||
/// ### Why is this bad?
|
/// ### Why is this bad?
|
||||||
/// Empty ranges yield no values so iterating them is a no-op.
|
/// Empty ranges yield no values so iterating them is a no-op.
|
||||||
|
|
Loading…
Reference in a new issue