bors 272bbfb857 Auto merge of #9386 - smoelius:further-enhance-needless-borrow, r=Jarcho
Further enhance `needless_borrow`, mildly refactor `redundant_clone`

This PR does the following:
* Moves some code from `redundant_clone` into a new `clippy_utils` module called `mir`, and wraps that code in a function called `dropped_without_further_use`.
* Relaxes the "is copyable" condition condition from #9136 by also suggesting to remove borrows from values dropped without further use. The changes involve the just mentioned function.
* Separates `redundant_clone` into modules.

Strictly speaking, the last bullet is independent of the others. `redundant_clone` is somewhat hairy, IMO. Separating it into modules makes it slightly less so, by helping to delineate what depends upon what.

I've tried to break everything up into digestible commits.

r? `@Jarcho`

(`@Jarcho` I hope you don't mind.)

changelog: continuation of #9136
2022-10-08 21:24:54 +00:00
..
2022-10-02 23:02:13 +08:00
2022-10-03 20:10:00 -03:00
2022-10-01 17:55:22 +02:00
2022-09-29 12:02:58 +02:00
2022-10-01 22:27:38 +00:00
2022-08-16 11:10:13 +10:00
2022-10-05 13:44:06 +00:00
2022-09-29 12:02:58 +02:00
2022-09-30 11:36:55 -04:00
2022-09-24 23:21:19 +09:00
2022-09-27 13:26:23 +02:00
2022-10-07 05:07:44 -04:00
2022-09-29 12:02:58 +02:00
2022-10-02 15:03:48 +02:00
2022-09-20 15:23:48 +02:00
2022-10-01 17:55:22 +02:00
2022-09-24 23:21:19 +09:00
2022-10-07 05:07:44 -04:00
2022-09-29 12:02:58 +02:00
2022-08-01 08:53:04 +10:00
2022-10-01 17:55:22 +02:00