You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, bad_bit_mask ignores masks that do not make the result of the whole expression constant, but don't add any value, e.g. x|0 or x & -1 or even x | 1 > 2 (because the former are always equal to x and latter is equal to x > 2 – they're not wrong per se, but may be misleading.
So let's have BitMask implement a second lint type (that is Warn instead of Deny), which I'd call ineffective_bit_mask.
The text was updated successfully, but these errors were encountered:
That, too. So the lint should probably only warn about bit masks that are not by themselves identity operations, but which are rendered ineffective by the comparison.
Another "identity_op" lint should then check direct identity operations.
Currently, bad_bit_mask ignores masks that do not make the result of the whole expression constant, but don't add any value, e.g.
x|0
orx & -1
or evenx | 1 > 2
(because the former are always equal tox
and latter is equal tox > 2
– they're not wrong per se, but may be misleading.So let's have BitMask implement a second lint type (that is Warn instead of Deny), which I'd call
ineffective_bit_mask
.The text was updated successfully, but these errors were encountered: