This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 4334919
committed
Auto merge of rust-lang#10143 - EricWu2003:field_reassign_with_default-FP, r=Manishearth
don't lint field_reassign when field in closure
fixes rust-lang#10136
This change makes the ContainsName struct visit all interior expressions, which means that ContainsName will return true even if `name` is used in a closure within `expr`.
---
changelog: FP: [`field_reassign_with_default`]: No longer lints cases, where values are initializes from closures capturing struct values
[rust-lang#10143](rust-lang/rust-clippy#10143)
<!-- changelog_checked -->File tree
5 files changed
+46
-8
lines changed- clippy_lints/src
- loops
- clippy_utils/src
- tests/ui
5 files changed
+46
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
528 | | - | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
529 | 533 | | |
530 | 534 | | |
531 | 535 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
| |||
1253 | 1255 | | |
1254 | 1256 | | |
1255 | 1257 | | |
1256 | | - | |
| 1258 | + | |
| 1259 | + | |
1257 | 1260 | | |
1258 | 1261 | | |
1259 | 1262 | | |
1260 | 1263 | | |
1261 | | - | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
1262 | 1267 | | |
1263 | 1268 | | |
1264 | 1269 | | |
1265 | 1270 | | |
1266 | 1271 | | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
1267 | 1276 | | |
1268 | 1277 | | |
1269 | 1278 | | |
1270 | | - | |
1271 | | - | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
1272 | 1285 | | |
1273 | 1286 | | |
1274 | 1287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
0 commit comments