Commit graph

15 commits

Author SHA1 Message Date
Samuel E. Moelius III
a05cb74d30 Enhance needless_borrow to consider trait implementations 2022-08-16 18:34:51 -04:00
Evan Typanski
40340745a8 Use parens around [needless_borrow] field calls 2022-07-19 15:17:24 -04:00
Jason Newcomb
988b813649 Use correct substitutions when checking if needless_borrow can apply to a method receiver 2022-07-02 15:48:46 -04:00
Jason Newcomb
6d21b79be9 Fix needless_borrow suggestion when calling a trait method taking self 2022-06-28 12:48:27 -04:00
Jason Newcomb
a187d6412b Merge different parent walking loops in dereference.rs
`needless_borrow` will now walk further to find the target type.
2022-06-28 12:48:26 -04:00
xFrednet
8db734990b
Fix #[expect] for async_yields_async 2022-06-06 14:13:28 +02:00
xFrednet
a613460e8a
Fix #[expect] for needless_borrow, ref_binding_to_ref 2022-06-06 11:51:36 +02:00
Jason Newcomb
a135b52102 Don't lint needless_borrow in method receiver positions 2022-02-16 23:14:39 -05:00
Jason Newcomb
9e9110e4f3 Remove final reference on fields and method calls in needless_borrow 2022-01-22 20:35:32 -05:00
Jason Newcomb
15c068ed0f Fix needless_borrow causing mutable borrows to be moved 2022-01-21 09:50:11 -05:00
Jason Newcomb
8ded385ddc Improve needless_borrow lint.
* Lint when a borrow is auto dereferenced more than once
* Lint when the expression is used as the expression of a block for a match arm

Moves `needless_borrow` and `ref_binding_to_reference` to `dereference`
lint pass in preperation for `explicit_auto_deref` lint.
2021-11-15 13:17:59 -05:00
dswij
81d57de791 Update needless_borrow test output and expected fix 2021-09-13 12:29:24 +08:00
Jason Newcomb
6d4dc35882
Improve needless_borrow lint
Suggest changing usages of ref bindings to match the new type
Split out some cases into new lint `ref_binding_to_reference`
2021-05-20 09:03:47 -04:00
David Tolnay
94154cad20
Downgrade trivially_copy_pass_by_ref to pedantic 2020-04-02 18:56:10 -07:00
Manish Goregaokar
622b167eb8 needless_borrow: allow other lints, make fixable 2019-09-25 14:45:18 -07:00