-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
A-user-storyArea: A user story or a related issueArea: A user story or a related issue
Description
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.
xFrednet
Metadata
Metadata
Assignees
Labels
A-user-storyArea: A user story or a related issueArea: A user story or a related issue