about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/trailing_zeros.rs
blob: 1cef8c2cfc997dc0a7937dbae6fcdcc7b872a8f7 (plain)
1
2
3
4
5
6
7
8
9
#![allow(unused_parens)]

fn main() {
    let x: i32 = 42;
    let _ = (x & 0b1111 == 0); // suggest trailing_zeros
    let _ = x & 0b1_1111 == 0; // suggest trailing_zeros
    let _ = x & 0b1_1010 == 0; // do not lint
    let _ = x & 1 == 0; // do not lint
}