2 #![warn(clippy::reversed_empty_ranges)]
5 const MAX_LEN: usize = 42;
7 for i in (0..10).rev() {
11 for i in (0..=10).rev() {
15 for i in (0..MAX_LEN).rev() {
20 // not an error, this is the range with only one element “5”
25 // not an error, the start index is less than the end index
34 for i in (0..10).rev().map(|x| x * 2) {
38 // testing that the empty range lint folds constants
39 for i in (5 + 4..10).rev() {
43 for i in ((3 - 1)..(5 + 2)).rev() {
47 for i in (2 * 2)..(2 * 3) {
48 // no error, 4..6 is fine
54 // no error, not constant-foldable