File tree 3 files changed +5
-22
lines changed
3 files changed +5
-22
lines changed Original file line number Diff line number Diff line change 1
- #![ feature( stmt_expr_attributes) ]
2
1
#![ allow( unused_parens) ]
3
2
4
3
fn main ( ) {
5
4
let x: i32 = 42 ;
6
- let _ = #[ clippy:: author]
7
- ( x & 0b1111 == 0 ) ; // suggest trailing_zeros
5
+ let _ = ( x & 0b1111 == 0 ) ; // suggest trailing_zeros
8
6
let _ = x & 0b1_1111 == 0 ; // suggest trailing_zeros
9
7
let _ = x & 0b1_1010 == 0 ; // do not lint
10
8
let _ = x & 1 == 0 ; // do not lint
Original file line number Diff line number Diff line change 1
1
error: 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
3
3
|
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`
6
6
|
7
7
= note: `-D clippy::verbose-bit-mask` implied by `-D warnings`
8
8
9
9
error: 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
11
11
|
12
12
LL | let _ = x & 0b1_1111 == 0; // suggest trailing_zeros
13
13
| ^^^^^^^^^^^^^^^^^ help: try: `x.trailing_zeros() >= 5`
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments