File tree 3 files changed +7
-7
lines changed
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -10,15 +10,15 @@ error: bit mask could be simplified with a call to `trailing_zeros`
10
10
--> bit_masks.rs:12:5
11
11
|
12
12
12 | x & 0 == 0;
13
- | ^^^^^^^^^^ help: try `x.trailing_zeros() > 0`
13
+ | ^^^^^^^^^^ help: try: `x.trailing_zeros() > 0`
14
14
|
15
15
= note: `-D verbose-bit-mask` implied by `-D warnings`
16
16
17
17
error: bit mask could be simplified with a call to `trailing_zeros`
18
18
--> bit_masks.rs:14:5
19
19
|
20
20
14 | x & 1 == 0; //ok, compared with zero
21
- | ^^^^^^^^^^ help: try `x.trailing_zeros() > 1`
21
+ | ^^^^^^^^^^ help: try: `x.trailing_zeros() > 1`
22
22
23
23
error: incompatible bit mask: `_ & 2` can never be equal to `1`
24
24
--> bit_masks.rs:15:5
Original file line number Diff line number Diff line change 5
5
fn main ( ) {
6
6
let x: i32 = 42 ;
7
7
let _ = #[ clippy ( author) ] ( x & 0b1111 == 0 ) ; // suggest trailing_zeros
8
- let _ = x & 0b11111 == 0 ; // suggest trailing_zeros
9
- let _ = x & 0b11010 == 0 ; // do not lint
8
+ let _ = x & 0b1_1111 == 0 ; // suggest trailing_zeros
9
+ let _ = x & 0b1_1010 == 0 ; // do not lint
10
10
}
Original file line number Diff line number Diff line change @@ -2,15 +2,15 @@ error: bit mask could be simplified with a call to `trailing_zeros`
2
2
--> trailing_zeros.rs:7:31
3
3
|
4
4
7 | let _ = #[clippy(author)] (x & 0b1111 == 0); // suggest trailing_zeros
5
- | ^^^^^^^^^^^^^^^^^ help: try `x.trailing_zeros() > 4`
5
+ | ^^^^^^^^^^^^^^^^^ help: try: `x.trailing_zeros() > 4`
6
6
|
7
7
= note: `-D verbose-bit-mask` implied by `-D warnings`
8
8
9
9
error: bit mask could be simplified with a call to `trailing_zeros`
10
10
--> trailing_zeros.rs:8:13
11
11
|
12
- 8 | let _ = x & 0b11111 == 0; // suggest trailing_zeros
13
- | ^^^^^^^^^^^^^^^^ help: try `x.trailing_zeros() > 5`
12
+ 8 | let _ = x & 0b1_1111 == 0; // suggest trailing_zeros
13
+ | ^^^^^^^^^^^^^^^^^ help: try: `x.trailing_zeros() > 5`
14
14
15
15
error: aborting due to 2 previous errors
16
16
You can’t perform that action at this time.
0 commit comments