Lint explanation
Bitwise negation might lead to hard-to-spot errors in case it is confused with a boolean negation.
Example code
let seq_id: u32;
if !seq_id > last_seq_id {/* deal with non-monotonic ids */}
Note that the code above is wrong and the intended code is
let seq_id: u32;
if !(seq_id > last_seq_id) {/* deal with non-monotonic ids */}
Notes
While this lint is very specific to if scenario above, we would be happy with a simple "no bitwise negation" lint as our codebase does not contain much of bit-twiddling.
Lint explanation
Bitwise negation might lead to hard-to-spot errors in case it is confused with a boolean negation.
Example code
Note that the code above is wrong and the intended code is
Notes
While this lint is very specific to
ifscenario above, we would be happy with a simple "no bitwise negation" lint as our codebase does not contain much of bit-twiddling.