7600535511
Improve `needless_lifetimes` This PR makes the following improvements to `needless_lifetimes`. * It fixes the following false negative, where `foo` is flagged but `bar` is not: ```rust fn foo<'a>(x: &'a u8, y: &'_ u8) {} fn bar<'a>(x: &'a u8, y: &'_ u8, z: &'_ u8) {} ``` * It flags more cases, generally. Previously, `needless_borrow` required *all* lifetimes to be used only once. With the changes, individual lifetimes are flagged for being used only once, even if not all lifetimes are. * Finally, it tries to produce more clear error messages. changelog: fix `needless_lifetimes` false negative involving functions with multiple unnamed lifetimes changelog: in `needless_lifetimes`, flag individual lifetimes used only once, rather than require all lifetimes to be used only once changelog: in `needless_lifetimes`, emit "replace with `'_`" warnings only when applicable, and point to a generic argument |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |