Commit 4e2b5d1
authored
Rollup merge of #107213 - edward-shen:edward-shen/fix-accidental-let-else, r=compiler-errors
Add suggestion to remove if in let..else block
Adds an additional hint to failures where we encounter an else keyword while we're parsing an if-let expression.
This is likely that the user has accidentally mixed if-let and let..else together.
Fixes #103791.File tree
6 files changed
+61
-14
lines changed- compiler
- rustc_error_messages/locales/en-US
- rustc_parse/src
- parser
- tests/ui
- let-else
- rfc-2497-if-let-chains
6 files changed
+61
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| 241 | + | |
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
340 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
341 | 343 | | |
342 | 344 | | |
343 | 345 | | |
| |||
348 | 350 | | |
349 | 351 | | |
350 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
351 | 360 | | |
352 | 361 | | |
353 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
2251 | 2251 | | |
2252 | 2252 | | |
2253 | 2253 | | |
2254 | | - | |
2255 | | - | |
2256 | | - | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
2257 | 2258 | | |
2258 | 2259 | | |
2259 | 2260 | | |
| |||
2279 | 2280 | | |
2280 | 2281 | | |
2281 | 2282 | | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
2282 | 2286 | | |
2283 | 2287 | | |
2284 | | - | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
2285 | 2292 | | |
2286 | 2293 | | |
2287 | 2294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| |||
0 commit comments