9907b90b1e
Add new `unconditional_recursion` lint Currently, rustc `unconditional_recursion` doesn't detect cases like: ```rust enum Foo { A, B, } impl PartialEq for Foo { fn eq(&self, other: &Self) -> bool { self == other } } ``` This is because the lint is currently implemented only for one level, and in the above code, `self == other` will then call `impl PartialEq for &T`, escaping from the detection. The fix for it seems to be a bit tricky (I started investigating potential solution to add one extra level of recursion [here](https://github.com/rust-lang/rust/compare/master...GuillaumeGomez:rust:trait-impl-recursion?expand=1) but completely broken at the moment). I expect that this situation will remain for a while. In the meantime, I think it's acceptable to check it directly into clippy for the time being as a lot of easy cases like this one can be easily checked (next I plan to extend it to cover other traits like `ToString`). changelog: Add new `unconditional_recursion` lint |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |