Commit 251a475
committed
Auto merge of rust-lang#11511 - Jarcho:split_borrow, r=llogiq
Split `needless_borrow` into two lints
Splits off the case where the borrow is used as a generic argument to a function. I think the two cases are different enough to warrant a separate lint.
The tests for the new lint have been reordered to group related parts together. Two warning have been dropped, one looked like it was testing the generic argument form, but it ends up triggering the auto-deref variant. The second was just a redundant test that didn't do anything interesting.
An issue with cycle detection is also included. The old version was checking if a cycle was reachable from a block when it should have been checking if the block is part or a cycle.
As a side note, I'm liking the style of just jamming all the tests into separate scopes in main.
changelog: Split off `needless_borrows_for_generic_args` from `needless_borrow`File tree
16 files changed
+1140
-1070
lines changed- clippy_lints/src
- clippy_utils/src/mir
- tests/ui
16 files changed
+1140
-1070
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5171 | 5171 | | |
5172 | 5172 | | |
5173 | 5173 | | |
| 5174 | + | |
5174 | 5175 | | |
5175 | 5176 | | |
5176 | 5177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
480 | 480 | | |
481 | 481 | | |
482 | 482 | | |
| 483 | + | |
483 | 484 | | |
484 | 485 | | |
485 | 486 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
231 | 232 | | |
232 | 233 | | |
233 | 234 | | |
| |||
887 | 888 | | |
888 | 889 | | |
889 | 890 | | |
890 | | - | |
| 891 | + | |
891 | 892 | | |
892 | 893 | | |
893 | 894 | | |
| |||
1111 | 1112 | | |
1112 | 1113 | | |
1113 | 1114 | | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1114 | 1120 | | |
1115 | 1121 | | |
1116 | 1122 | | |
| |||
0 commit comments