Commit 94e8c6c
authored
Rollup merge of #123067 - Nadrieril:always-simplify-or, r=oli-obk
match lowering: consistently merge simple or-patterns
There are two places where we expand or-patterns in match lowering: the main one is `test_candidates_with_or`, and there's one in `match_candidates` that's an optimization for the simple case where the whole pattern is just one or-pattern.
To reduce duplication, we merge or-pattern alternatives into a single block when possible, but we only to that in `test_candidates_with_or`. This PR fixes this oversight and merges them in `match_candidates` too.
This is a part of splitting up #122046 into smaller bits.File tree
3 files changed
+28
-29
lines changed- compiler/rustc_mir_build/src/build/matches
- tests/mir-opt/issues
3 files changed
+28
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1006 | 1006 | | |
1007 | 1007 | | |
1008 | 1008 | | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
1009 | 1013 | | |
1010 | 1014 | | |
1011 | 1015 | | |
| |||
1028 | 1032 | | |
1029 | 1033 | | |
1030 | 1034 | | |
| 1035 | + | |
1031 | 1036 | | |
1032 | 1037 | | |
1033 | 1038 | | |
| |||
1277 | 1282 | | |
1278 | 1283 | | |
1279 | 1284 | | |
1280 | | - | |
| 1285 | + | |
| 1286 | + | |
1281 | 1287 | | |
1282 | 1288 | | |
1283 | 1289 | | |
| |||
1287 | 1293 | | |
1288 | 1294 | | |
1289 | 1295 | | |
1290 | | - | |
1291 | | - | |
| 1296 | + | |
1292 | 1297 | | |
1293 | 1298 | | |
1294 | 1299 | | |
| |||
1298 | 1303 | | |
1299 | 1304 | | |
1300 | 1305 | | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
1301 | 1310 | | |
1302 | 1311 | | |
1303 | 1312 | | |
| |||
1531 | 1540 | | |
1532 | 1541 | | |
1533 | 1542 | | |
1534 | | - | |
| 1543 | + | |
| 1544 | + | |
1535 | 1545 | | |
1536 | 1546 | | |
1537 | 1547 | | |
1538 | 1548 | | |
1539 | | - | |
1540 | | - | |
1541 | | - | |
1542 | | - | |
1543 | | - | |
| 1549 | + | |
1544 | 1550 | | |
1545 | 1551 | | |
1546 | 1552 | | |
| |||
1550 | 1556 | | |
1551 | 1557 | | |
1552 | 1558 | | |
1553 | | - | |
| 1559 | + | |
1554 | 1560 | | |
1555 | 1561 | | |
1556 | 1562 | | |
| |||
1559 | 1565 | | |
1560 | 1566 | | |
1561 | 1567 | | |
| 1568 | + | |
| 1569 | + | |
1562 | 1570 | | |
1563 | 1571 | | |
1564 | 1572 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
Lines changed: 8 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | | - | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | 55 | | |
66 | | - | |
| 56 | + | |
67 | 57 | | |
68 | 58 | | |
69 | | - | |
| 59 | + | |
70 | 60 | | |
71 | 61 | | |
72 | 62 | | |
| |||
0 commit comments