I’ve watched rust development for some time and when the beta arrived I decided it was time to jump into learning the language. Since I very much like the idea of static analysis (and rust is already strong in that area), I tried to write a lint that would be simple enough for me to handle, but still useful enough to be…well, useful.
Thus, I started the extra_lints project, which can now be found on https://github.com/llogiq/extra_lints .
The first two lints (appear to) work: a check for equal sub-expressions of comparison or bit-wise combining binary operations (e.g.
1 == 1) and a check for bad bit masks (e.g.
x & 1 == 3).
If some of you have time and interest, I’d be grateful for a bit of code review; what could I have done better? Also I’d like to kickstart the discussion:
- Should those belong in rustc?
- Should a lint that catches harmless errors
Warnif the code in question is certainly an error?
- What simple lints would you like to see?