|
1 |
| -error: it appears you are trying to get the maximum value of an integer, but `^` is not an exponentiation operator |
2 |
| - --> $DIR/xor_used_as_pow.rs:12:20 |
| 1 | +error: it appears you are trying to get a power of two, but `^` is not an exponentiation operator |
| 2 | + --> $DIR/xor_used_as_pow.rs:22:13 |
3 | 3 | |
|
4 |
| -LL | println!("{}", 2 ^ 16); |
5 |
| - | ^^^^^^ help: try: `std::u16::MAX` |
| 4 | +LL | let _ = 2 ^ 3; |
| 5 | + | ^^^^^ help: use a bitshift instead: `1_u32 << 3` |
6 | 6 | |
|
7 | 7 | = note: `-D clippy::xor-used-as-pow` implied by `-D warnings`
|
8 | 8 |
|
| 9 | +error: `^` is not an exponentiation operator but appears to have been used as one |
| 10 | + --> $DIR/xor_used_as_pow.rs:23:13 |
| 11 | + | |
| 12 | +LL | let _ = 10 ^ 4; |
| 13 | + | ^^^^^^ |
| 14 | + | |
| 15 | + = help: did you mean to use .pow()? |
| 16 | + |
| 17 | +error: it appears you are trying to get a power of two, but `^` is not an exponentiation operator |
| 18 | + --> $DIR/xor_used_as_pow.rs:24:13 |
| 19 | + | |
| 20 | +LL | let _ = 2 ^ 32; |
| 21 | + | ^^^^^^ help: use a bitshift instead: `1_u64 << 32` |
| 22 | + |
| 23 | +error: the operation is ineffective. Consider reducing it to `2` |
| 24 | + --> $DIR/xor_used_as_pow.rs:25:13 |
| 25 | + | |
| 26 | +LL | let _ = 2 ^ 0; |
| 27 | + | ^^^^^ |
| 28 | + | |
| 29 | + = note: `-D clippy::identity-op` implied by `-D warnings` |
| 30 | + |
9 | 31 | error: it appears you are trying to get a power of two, but `^` is not an exponentiation operator
|
10 |
| - --> $DIR/xor_used_as_pow.rs:13:20 |
| 32 | + --> $DIR/xor_used_as_pow.rs:25:13 |
| 33 | + | |
| 34 | +LL | let _ = 2 ^ 0; |
| 35 | + | ^^^^^ help: try: `1` |
| 36 | + |
| 37 | +error: the operation is ineffective. Consider reducing it to `10` |
| 38 | + --> $DIR/xor_used_as_pow.rs:26:13 |
11 | 39 | |
|
12 |
| -LL | println!("{}", 2 ^ 7); |
13 |
| - | ^^^^^ help: use a bitshift instead: `1 << 7` |
| 40 | +LL | let _ = 10 ^ 0; |
| 41 | + | ^^^^^^ |
14 | 42 |
|
15 | 43 | error: `^` is not an exponentiation operator but appears to have been used as one
|
16 |
| - --> $DIR/xor_used_as_pow.rs:14:20 |
| 44 | + --> $DIR/xor_used_as_pow.rs:26:13 |
17 | 45 | |
|
18 |
| -LL | println!("{}", 9 ^ 3); |
19 |
| - | ^^^^^ |
| 46 | +LL | let _ = 10 ^ 0; |
| 47 | + | ^^^^^^ |
20 | 48 | |
|
21 | 49 | = help: did you mean to use .pow()?
|
22 | 50 |
|
23 |
| -error: aborting due to 3 previous errors |
| 51 | +error: aborting due to 7 previous errors |
24 | 52 |
|
0 commit comments