diff options
| author | bors <bors@rust-lang.org> | 2022-11-01 00:25:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-11-01 00:25:30 +0000 |
| commit | 7600535511a0b8c76bf28f40e1b5c4a45a57b28f (patch) | |
| tree | fb9dd7a6040a14fb0c9894b6f3c3e99d1daa71cc /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp | |
| parent | 37d338c1efd7840fa96c5eaeaa5785094efdab07 (diff) | |
| parent | c0d928561c3b88b294ddffaf8f8179f672babcda (diff) | |
| download | rust-7600535511a0b8c76bf28f40e1b5c4a45a57b28f.tar.gz rust-7600535511a0b8c76bf28f40e1b5c4a45a57b28f.zip | |
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
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
