rust/clippy_utils/src
bors 7600535511 Auto merge of #9743 - smoelius:improve-needless-lifetimes, r=Alexendoo
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
2022-11-01 00:25:30 +00:00
..
ast_utils Merge commit '928e72dd10' into clippyup 2021-02-25 11:25:22 +01:00
mir Fix bug in referent_used_exactly_once 2022-10-12 09:21:08 -04:00
ast_utils.rs Rename AssocItemKind::TyAlias to AssocItemKind::Type 2022-10-10 02:31:37 +00:00
attrs.rs Fix adjacent code 2022-10-07 05:07:44 -04:00
check_proc_macro.rs ImplItemKind::TyAlias => ImplItemKind::Type 2022-10-09 07:09:57 +00:00
comparisons.rs Merge commit '928e72dd10' into clippyup 2021-02-25 11:25:22 +01:00
consts.rs Fix dogfooding 2022-10-24 22:05:39 +02:00
diagnostics.rs Fix adjacent code 2022-10-28 13:18:07 -04:00
eager_or_lazy.rs Don't suggest moving tuple structs with a significant drop to late evaluation. 2022-10-08 11:23:05 -04:00
higher.rs Merge commit 'd9ddce8a22' into clippyup 2022-06-04 13:34:07 +02:00
hir_utils.rs Fix dogfooding 2022-10-24 22:05:39 +02:00
lib.rs Fix adjacent code 2022-10-28 13:18:07 -04:00
macros.rs Add unused_format_specs lint 2022-10-17 11:36:05 +00:00
msrvs.rs feat: add new lint seek_from_current 2022-10-25 12:26:06 +09:00
numeric_literal.rs [unnecessary_cast] Do not lint negative hexadecimal literals when cast as float 2022-10-08 16:15:18 +02:00
paths.rs feat: add new lint seek_from_current 2022-10-25 12:26:06 +09:00
ptr.rs Merge commit 'ac0e10aa68' into clippyup 2022-10-06 09:44:38 +02:00
qualify_min_const_fn.rs Fix adjacent code 2022-10-28 13:18:07 -04:00
source.rs Merge commit 'ac0e10aa68' into clippyup 2022-10-06 09:44:38 +02:00
str_utils.rs Merge commit '0eff589afc' into clippyup 2021-12-30 15:10:43 +01:00
sugg.rs Fix adjacent code 2022-10-28 13:18:07 -04:00
sym_helper.rs Merge commit '928e72dd10' into clippyup 2021-02-25 11:25:22 +01:00
ty.rs Ensure new_ret_no_self is not fired if impl Trait<Self> is returned. 2022-10-27 18:49:07 +01:00
usage.rs Change InferCtxtBuilder from enter to build 2022-10-07 07:10:40 -05:00
visitors.rs Merge commit 'ac0e10aa68' into clippyup 2022-10-06 09:44:38 +02:00