Hey, I would love to add a few lints to that which are fairly super pedantic. We use them (or rather a shell script that checks for them :P) at the moment to ensure error handling/non crashy behaviour in our codebase they sum up to:
[....]but before I go ahead I'd like to get an opinion of those would be accepted?
Some of those lints already exist, most others are low hanging fruits. Have a look at the restriction lint group. For the lints that don't exist yet: Yes they would be accepted in exactly that restriction group.
Lints that already exist:
let _ on results / must_use⁴dbg! [1]std::process::exit³¹easy extension of unimplemented
²easy extension of unwrap lints
³should be fairly easy to implement (just a function path check)
⁴may be a bit harder to implement, dependent on how complicated it is to find out if a type is must_use
If you want to implement the other lints you're more than welcome! Have a look at https://github.com/rust-lang/rust-clippy/blob/master/doc/adding_lints.md first, and if you have any questions, don't hesitate to ask!
I opend #4697 for exit but I think the let _... = one is a bit too complex for me at the moment. Since all the rest is done, would it make sense to split that out into an extra, more focused, issue and close this?
We have a check for #[must_use] types in functions.rs already (IIRC is_must_use_ty(cx, ty), we best move this to utils/mod.rs), that you can call with the result of an expr_ty(cx, _) on the initializer.
Since the let _ = ... lint is the only one missing in this issue, I moved it to #4812
Most helpful comment
Some of those lints already exist, most others are low hanging fruits. Have a look at the
restrictionlint group. For the lints that don't exist yet: Yes they would be accepted in exactly thatrestrictiongroup.Lints that already exist:
let _on results /must_use⁴dbg![1]std::process::exit³¹easy extension of
unimplemented²easy extension of
unwraplints³should be fairly easy to implement (just a function path check)
⁴may be a bit harder to implement, dependent on how complicated it is to find out if a type is
must_useIf you want to implement the other lints you're more than welcome! Have a look at https://github.com/rust-lang/rust-clippy/blob/master/doc/adding_lints.md first, and if you have any questions, don't hesitate to ask!