about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/len_zero_ranges.rs
blob: 98c97ca02457a6c720f7e5dea0ef9ff7fa87b515 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![warn(clippy::len_zero)]
#![allow(unused)]

// Now that `Range(Inclusive)::is_empty` is stable (1.47), we can always suggest this
mod issue_3807 {
    fn suggestion_is_fine_range() {
        let _ = (0..42).len() == 0;
        //~^ len_zero
    }

    fn suggestion_is_fine_range_inclusive() {
        let _ = (0_u8..=42).len() == 0;
        //~^ len_zero
    }
}

fn main() {}