Commit 37e1d29
Don't rerun Mir passes when inlining
When inlining a function using the Mir inliner, we shouldn't rerun the
various Mir passes on it because the Mir has already been lowered and
that wil break various early Mir passes.
The issue in rust-lang#50411 is that we've inlined a function with promotions
whose Mir has already been lowered. The promotions are then copied into
the local function and we begin to run passes on their lowered Mir
which causes the ICE.
Fixes rust-lang#504111 parent 22cc2ae commit 37e1d29
File tree
3 files changed
+60
-5
lines changed- src
- librustc_mir/transform
- librustc/mir
- test/ui/issues
3 files changed
+60
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
72 | 83 | | |
73 | 84 | | |
74 | 85 | | |
75 | 86 | | |
76 | 87 | | |
77 | 88 | | |
78 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
79 | 97 | | |
80 | 98 | | |
81 | 99 | | |
| |||
151 | 169 | | |
152 | 170 | | |
153 | 171 | | |
| 172 | + | |
154 | 173 | | |
155 | 174 | | |
156 | 175 | | |
| |||
368 | 387 | | |
369 | 388 | | |
370 | 389 | | |
| 390 | + | |
371 | 391 | | |
372 | 392 | | |
373 | 393 | | |
| |||
616 | 636 | | |
617 | 637 | | |
618 | 638 | | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
619 | 646 | | |
620 | 647 | | |
621 | 648 | | |
| |||
2777 | 2804 | | |
2778 | 2805 | | |
2779 | 2806 | | |
| 2807 | + | |
2780 | 2808 | | |
2781 | 2809 | | |
2782 | 2810 | | |
| |||
2789 | 2817 | | |
2790 | 2818 | | |
2791 | 2819 | | |
| 2820 | + | |
2792 | 2821 | | |
2793 | 2822 | | |
2794 | 2823 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
159 | 166 | | |
160 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
161 | 174 | | |
162 | 175 | | |
163 | 176 | | |
| |||
175 | 188 | | |
176 | 189 | | |
177 | 190 | | |
| 191 | + | |
| 192 | + | |
178 | 193 | | |
179 | 194 | | |
180 | 195 | | |
| |||
192 | 207 | | |
193 | 208 | | |
194 | 209 | | |
195 | | - | |
| 210 | + | |
196 | 211 | | |
197 | 212 | | |
198 | 213 | | |
| |||
214 | 229 | | |
215 | 230 | | |
216 | 231 | | |
217 | | - | |
| 232 | + | |
218 | 233 | | |
219 | 234 | | |
220 | 235 | | |
| |||
232 | 247 | | |
233 | 248 | | |
234 | 249 | | |
235 | | - | |
| 250 | + | |
236 | 251 | | |
237 | 252 | | |
238 | 253 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments