rust/clippy_lints/src/functions
bors 73efce9ee6 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.
2022-11-21 19:51:42 +00:00
..
misnamed_getters.rs Fix many false negatives caused by autoderef 2022-11-20 17:03:53 +01:00
mod.rs misname-getters: Fix documentation 2022-11-20 13:46:38 +01:00
must_use.rs Merge remote-tracking branch 'upstream/master' into rustup 2022-11-21 20:01:17 +01:00
not_unsafe_ptr_arg_deref.rs Rename some OwnerId fields. 2022-10-29 20:28:38 +11:00
result.rs Merge remote-tracking branch 'upstream/master' into rustup 2022-11-21 20:01:17 +01:00
too_many_arguments.rs Merge commit 'ac0e10aa68' into clippyup 2022-10-06 09:44:38 +02:00
too_many_lines.rs Merge commit '4f142aa105' into clippyup 2022-10-23 15:18:45 +02:00