This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit d39daec
committed
Auto merge of rust-lang#120904 - Nadrieril:match-lowering-intermediate-repr, r=<try>
match lowering: eagerly simplify match pairs
This removes one important complication from match lowering. Before this, match pair simplification (which includes collecting bindings and type ascriptions) was intertwined with the whole match lowering algorithm.
I'm avoiding this by storing in each `MatchPair` the sub-`MatchPair`s that correspond to its subfields. This makes it possible to simplify everything (except or-patterns) in `Candidate::new()`.
This should open up further simplifications. It will also give us proper control over the order of bindings.
r? `@matthewjasper`File tree
5 files changed
+197
-245
lines changed- compiler/rustc_mir_build/src/build/matches
- tests/mir-opt
5 files changed
+197
-245
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
| |||
951 | 949 | | |
952 | 950 | | |
953 | 951 | | |
954 | | - | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
955 | 955 | | |
956 | 956 | | |
| 957 | + | |
957 | 958 | | |
958 | 959 | | |
959 | 960 | | |
| 961 | + | |
960 | 962 | | |
961 | 963 | | |
962 | 964 | | |
| |||
976 | 978 | | |
977 | 979 | | |
978 | 980 | | |
979 | | - | |
| 981 | + | |
980 | 982 | | |
981 | | - | |
| 983 | + | |
982 | 984 | | |
983 | 985 | | |
984 | | - | |
| 986 | + | |
985 | 987 | | |
986 | 988 | | |
987 | 989 | | |
988 | 990 | | |
989 | 991 | | |
990 | 992 | | |
991 | | - | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
992 | 1002 | | |
993 | 1003 | | |
994 | 1004 | | |
| |||
1044 | 1054 | | |
1045 | 1055 | | |
1046 | 1056 | | |
1047 | | - | |
| 1057 | + | |
1048 | 1058 | | |
1049 | | - | |
| 1059 | + | |
1050 | 1060 | | |
1051 | 1061 | | |
1052 | 1062 | | |
| 1063 | + | |
| 1064 | + | |
1053 | 1065 | | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
1054 | 1069 | | |
1055 | 1070 | | |
1056 | 1071 | | |
| |||
1172 | 1187 | | |
1173 | 1188 | | |
1174 | 1189 | | |
1175 | | - | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
1176 | 1207 | | |
1177 | 1208 | | |
1178 | 1209 | | |
| |||
0 commit comments