File tree Expand file tree Collapse file tree 3 files changed +5
-22
lines changed Expand file tree Collapse file tree 3 files changed +5
-22
lines changed Original file line number Diff line number Diff line change 1- #![ feature( stmt_expr_attributes) ]
21#![ allow( unused_parens) ]
32
43fn main ( ) {
54 let x: i32 = 42 ;
6- let _ = #[ clippy:: author]
7- ( x & 0b1111 == 0 ) ; // suggest trailing_zeros
5+ let _ = ( x & 0b1111 == 0 ) ; // suggest trailing_zeros
86 let _ = x & 0b1_1111 == 0 ; // suggest trailing_zeros
97 let _ = x & 0b1_1010 == 0 ; // do not lint
108 let _ = x & 1 == 0 ; // do not lint
Original file line number Diff line number Diff line change 11error: bit mask could be simplified with a call to `trailing_zeros`
2- --> $DIR/trailing_zeros.rs:7:5
2+ --> $DIR/trailing_zeros.rs:5:13
33 |
4- LL | (x & 0b1111 == 0); // suggest trailing_zeros
5- | ^^^^^^^^^^^^^^^^^ help: try: `x.trailing_zeros() >= 4`
4+ LL | let _ = (x & 0b1111 == 0); // suggest trailing_zeros
5+ | ^^^^^^^^^^^^^^^^^ help: try: `x.trailing_zeros() >= 4`
66 |
77 = note: `-D clippy::verbose-bit-mask` implied by `-D warnings`
88
99error: bit mask could be simplified with a call to `trailing_zeros`
10- --> $DIR/trailing_zeros.rs:8 :13
10+ --> $DIR/trailing_zeros.rs:6 :13
1111 |
1212LL | let _ = x & 0b1_1111 == 0; // suggest trailing_zeros
1313 | ^^^^^^^^^^^^^^^^^ help: try: `x.trailing_zeros() >= 5`
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments