Skip to content

Commit 1b9a25e

Browse files
committed
[rust-lang#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 rust-lang#5689 and rust-lang#5628
1 parent 179a22f commit 1b9a25e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/ranges.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ declare_clippy_lint! {
103103
declare_clippy_lint! {
104104
/// ### What it does
105105
/// Checks for range expressions `x..y` where both `x` and `y`
106-
/// are constant and `x` is greater or equal to `y`.
106+
/// are constant and `x` is greater to `y`. Also triggers if `x` is equal to `y` when they are conditions to a `for` loop.
107107
///
108108
/// ### Why is this bad?
109109
/// Empty ranges yield no values so iterating them is a no-op.

0 commit comments

Comments
 (0)