diff options
| author | bors <bors@rust-lang.org> | 2022-11-21 19:51:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-11-21 19:51:42 +0000 |
| commit | 73efce9ee6e971f45b20976c1efd96888faf4a1d (patch) | |
| tree | b56161255fcea8438eb7b4a0709a7d3bd06dc15d /src/test/rustdoc-ui/coverage/enum-tuple.rs | |
| parent | f4850f7292efa33759b4f7f9b7621268979e9914 (diff) | |
| parent | 1f2f50c34eb304ce56213dad70ccdeb2f2901512 (diff) | |
| download | rust-73efce9ee6e971f45b20976c1efd96888faf4a1d.tar.gz rust-73efce9ee6e971f45b20976c1efd96888faf4a1d.zip | |
Auto merge of #9770 - sgued:missnamed-getters, r=llogiq
Add new lint [`misnamed-getters`] ``` changelog: Add new lint [`misnamed-getters`] ``` Closes #9769 The current lint matches all methods with a body of just one expression under the form `(&mut?)? <expr>.field` where field doesn't match the name of the method but there is a field of the same type in `<expr>` that matches the name. This allows matching nested structs, for example for newtype wrappers. This may cast the net a bit too wide and cause false positives. I'll run [clippy_lint_tester](https://github.com/mikerite/clippy_lint_tester) on the top crates to see how frequently false positives happen. There also may be room for improvement by checking that the replacement field would work taking into account implementations of `Deref` and `DerefMut` even if the types don't exactly match but I don't know yet how this could be done.
Diffstat (limited to 'src/test/rustdoc-ui/coverage/enum-tuple.rs')
0 files changed, 0 insertions, 0 deletions
