mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 17:07:17 +00:00
15 lines
428 B
Rust
15 lines
428 B
Rust
#![warn(clippy::reversed_empty_ranges)]
|
|
#![allow(clippy::uninlined_format_args)]
|
|
|
|
fn main() {
|
|
for i in 5..5 {
|
|
//~^ ERROR: this range is empty so it will yield no values
|
|
//~| NOTE: `-D clippy::reversed-empty-ranges` implied by `-D warnings`
|
|
println!("{}", i);
|
|
}
|
|
|
|
for i in (5 + 2)..(8 - 1) {
|
|
//~^ ERROR: this range is empty so it will yield no values
|
|
println!("{}", i);
|
|
}
|
|
}
|