Commit d83abe8
authored
Rollup merge of rust-lang#100522 - cjgillot:inline-polymorphic-recursion, r=tmiasko
Only check the `DefId` for the recursion check in MIR inliner.
The current history check compares `Instance`s, so it cannot detect cases of polymorphic recursion where `Substs` change.
This PR makes it so we only compare `DefId`s, ignoring any change in `Substs`.
According to rust-lang#100522 (comment), in practice only very few inlining decisions change.
Fixes rust-lang#100476File tree
2 files changed
+34
-4
lines changed- compiler/rustc_mir_transform/src
- src/test/mir-opt/inline
2 files changed
+34
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
106 | | - | |
107 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
108 | 113 | | |
109 | 114 | | |
110 | 115 | | |
| |||
132 | 137 | | |
133 | 138 | | |
134 | 139 | | |
135 | | - | |
| 140 | + | |
136 | 141 | | |
137 | 142 | | |
138 | 143 | | |
| |||
308 | 313 | | |
309 | 314 | | |
310 | 315 | | |
311 | | - | |
| 316 | + | |
312 | 317 | | |
313 | 318 | | |
314 | 319 | | |
| |||
| 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 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments