blob: f3d3ac298cec8508a8ac52bb00114bea892fe660 [file] [log] [blame]
error: this range is empty so it will yield no values
--> tests/ui/reversed_empty_ranges_fixable.rs:9:6
|
LL | (42..=21).for_each(|x| println!("{}", x));
| ^^^^^^^
|
= note: `-D clippy::reversed-empty-ranges` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::reversed_empty_ranges)]`
help: consider using the following if you are attempting to iterate over this range in reverse
|
LL - (42..=21).for_each(|x| println!("{}", x));
LL + ((21..=42).rev()).for_each(|x| println!("{}", x));
|
error: this range is empty so it will yield no values
--> tests/ui/reversed_empty_ranges_fixable.rs:11:14
|
LL | let _ = (ANSWER..21).filter(|x| x % 2 == 0).take(10).collect::<Vec<_>>();
| ^^^^^^^^^^
|
help: consider using the following if you are attempting to iterate over this range in reverse
|
LL - let _ = (ANSWER..21).filter(|x| x % 2 == 0).take(10).collect::<Vec<_>>();
LL + let _ = ((21..ANSWER).rev()).filter(|x| x % 2 == 0).take(10).collect::<Vec<_>>();
|
error: this range is empty so it will yield no values
--> tests/ui/reversed_empty_ranges_fixable.rs:14:14
|
LL | for _ in -21..=-42 {}
| ^^^^^^^^^
|
help: consider using the following if you are attempting to iterate over this range in reverse
|
LL - for _ in -21..=-42 {}
LL + for _ in (-42..=-21).rev() {}
|
error: this range is empty so it will yield no values
--> tests/ui/reversed_empty_ranges_fixable.rs:16:14
|
LL | for _ in 42u32..21u32 {}
| ^^^^^^^^^^^^
|
help: consider using the following if you are attempting to iterate over this range in reverse
|
LL - for _ in 42u32..21u32 {}
LL + for _ in (21u32..42u32).rev() {}
|
error: aborting due to 4 previous errors