rust-clippy/clippy_tests/examples/bit_masks.stderr

113 lines
2.7 KiB
Text
Raw Normal View History

error: &-masking with zero
--> bit_masks.rs:12:5
|
2017-02-08 13:58:07 +00:00
12 | x & 0 == 0;
| ^^^^^^^^^^
|
= note: `-D bad-bit-mask` implied by `-D warnings`
error: bit mask could be simplified with a call to `trailing_zeros`
--> bit_masks.rs:12:5
|
12 | x & 0 == 0;
| ^^^^^^^^^^ help: try: `x.trailing_zeros() > 0`
|
= note: `-D verbose-bit-mask` implied by `-D warnings`
error: bit mask could be simplified with a call to `trailing_zeros`
--> bit_masks.rs:14:5
|
14 | x & 1 == 0; //ok, compared with zero
| ^^^^^^^^^^ help: try: `x.trailing_zeros() > 1`
error: incompatible bit mask: `_ & 2` can never be equal to `1`
--> bit_masks.rs:15:5
|
2017-02-08 13:58:07 +00:00
15 | x & 2 == 1;
| ^^^^^^^^^^
error: incompatible bit mask: `_ | 3` can never be equal to `2`
--> bit_masks.rs:19:5
|
2017-02-08 13:58:07 +00:00
19 | x | 3 == 2;
| ^^^^^^^^^^
error: incompatible bit mask: `_ & 1` will never be higher than `1`
--> bit_masks.rs:21:5
|
2017-02-08 13:58:07 +00:00
21 | x & 1 > 1;
| ^^^^^^^^^
error: incompatible bit mask: `_ | 2` will always be higher than `1`
--> bit_masks.rs:25:5
|
2017-02-08 13:58:07 +00:00
25 | x | 2 > 1;
| ^^^^^^^^^
error: incompatible bit mask: `_ & 7` can never be equal to `8`
--> bit_masks.rs:32:5
|
2017-02-08 13:58:07 +00:00
32 | x & THREE_BITS == 8;
| ^^^^^^^^^^^^^^^^^^^
error: incompatible bit mask: `_ | 7` will never be lower than `7`
--> bit_masks.rs:33:5
|
2017-02-08 13:58:07 +00:00
33 | x | EVEN_MORE_REDIRECTION < 7;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: &-masking with zero
--> bit_masks.rs:35:5
|
2017-02-08 13:58:07 +00:00
35 | 0 & x == 0;
| ^^^^^^^^^^
error: incompatible bit mask: `_ | 2` will always be higher than `1`
--> bit_masks.rs:39:5
|
2017-02-08 13:58:07 +00:00
39 | 1 < 2 | x;
| ^^^^^^^^^
error: incompatible bit mask: `_ | 3` can never be equal to `2`
--> bit_masks.rs:40:5
|
2017-02-08 13:58:07 +00:00
40 | 2 == 3 | x;
| ^^^^^^^^^^
error: incompatible bit mask: `_ & 2` can never be equal to `1`
--> bit_masks.rs:41:5
|
2017-02-08 13:58:07 +00:00
41 | 1 == x & 2;
| ^^^^^^^^^^
error: ineffective bit mask: `x | 1` compared to `3`, is the same as x compared directly
--> bit_masks.rs:52:5
|
2017-02-08 13:58:07 +00:00
52 | x | 1 > 3;
| ^^^^^^^^^
|
= note: `-D ineffective-bit-mask` implied by `-D warnings`
error: ineffective bit mask: `x | 1` compared to `4`, is the same as x compared directly
--> bit_masks.rs:53:5
|
2017-02-08 13:58:07 +00:00
53 | x | 1 < 4;
| ^^^^^^^^^
error: ineffective bit mask: `x | 1` compared to `3`, is the same as x compared directly
--> bit_masks.rs:54:5
|
2017-02-08 13:58:07 +00:00
54 | x | 1 <= 3;
| ^^^^^^^^^^
error: ineffective bit mask: `x | 1` compared to `8`, is the same as x compared directly
--> bit_masks.rs:55:5
|
2017-02-08 13:58:07 +00:00
55 | x | 1 >= 8;
| ^^^^^^^^^^
error: aborting due to 17 previous errors
To learn more, run the command again with --verbose.