blob: 5781a093d5f2b9c6353accd74d21d4ece5d37e9b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
error: manually reimplementing `is_power_of_two`
--> tests/ui/manual_is_power_of_two.rs:19:13
|
LL | let _ = a.count_ones() == 1;
| ^^^^^^^^^^^^^^^^^^^ help: consider using `.is_power_of_two()`: `a.is_power_of_two()`
|
= note: `-D clippy::manual-is-power-of-two` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::manual_is_power_of_two)]`
error: manually reimplementing `is_power_of_two`
--> tests/ui/manual_is_power_of_two.rs:21:13
|
LL | let _ = u64::count_ones(a) == 1;
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.is_power_of_two()`: `a.is_power_of_two()`
error: manually reimplementing `is_power_of_two`
--> tests/ui/manual_is_power_of_two.rs:23:13
|
LL | let _ = a & (a - 1) == 0;
| ^^^^^^^^^^^^^^^^ help: consider using `.is_power_of_two()`: `a.is_power_of_two()`
error: manually reimplementing `is_power_of_two`
--> tests/ui/manual_is_power_of_two.rs:27:13
|
LL | let _ = 1 == a.count_ones();
| ^^^^^^^^^^^^^^^^^^^ help: consider using `.is_power_of_two()`: `a.is_power_of_two()`
error: manually reimplementing `is_power_of_two`
--> tests/ui/manual_is_power_of_two.rs:29:13
|
LL | let _ = (a - 1) & a == 0;
| ^^^^^^^^^^^^^^^^ help: consider using `.is_power_of_two()`: `a.is_power_of_two()`
error: manually reimplementing `is_power_of_two`
--> tests/ui/manual_is_power_of_two.rs:31:13
|
LL | let _ = 0 == a & (a - 1);
| ^^^^^^^^^^^^^^^^ help: consider using `.is_power_of_two()`: `a.is_power_of_two()`
error: manually reimplementing `is_power_of_two`
--> tests/ui/manual_is_power_of_two.rs:33:13
|
LL | let _ = 0 == (a - 1) & a;
| ^^^^^^^^^^^^^^^^ help: consider using `.is_power_of_two()`: `a.is_power_of_two()`
error: manually reimplementing `is_power_of_two`
--> tests/ui/manual_is_power_of_two.rs:43:13
|
LL | let _ = i as u32 & (i as u32 - 1) == 0;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.is_power_of_two()`: `(i as u32).is_power_of_two()`
error: manually reimplementing `is_power_of_two`
--> tests/ui/manual_is_power_of_two.rs:58:5
|
LL | a & (a - 1) == 0
| ^^^^^^^^^^^^^^^^ help: consider using `.is_power_of_two()`: `a.is_power_of_two()`
error: aborting due to 9 previous errors
|