Commit 9a70eee
committed
compiler: ensure local
This fixes a bug which exposed a compiler implementation detail (ZIR
alloc elision). Previously, `const` declarations with a runtime-known
value in a comptime scope were permitted only if AstGen was able to
elide the alloc in ZIR, since the error was reported by storing to the
comptime alloc.
This just adds a new instruction to also emit this error when the alloc
is elided.consts in comptime scope are comptime-known1 parent 6026a5f commit 9a70eee
4 files changed
+29
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2963 | 2963 | | |
2964 | 2964 | | |
2965 | 2965 | | |
| 2966 | + | |
2966 | 2967 | | |
2967 | 2968 | | |
2968 | 2969 | | |
| |||
3280 | 3281 | | |
3281 | 3282 | | |
3282 | 3283 | | |
| 3284 | + | |
3283 | 3285 | | |
3284 | 3286 | | |
3285 | 3287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
711 | 711 | | |
712 | 712 | | |
713 | 713 | | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
714 | 720 | | |
715 | 721 | | |
716 | 722 | | |
| |||
1293 | 1299 | | |
1294 | 1300 | | |
1295 | 1301 | | |
| 1302 | + | |
1296 | 1303 | | |
1297 | 1304 | | |
1298 | 1305 | | |
| |||
1353 | 1360 | | |
1354 | 1361 | | |
1355 | 1362 | | |
| 1363 | + | |
1356 | 1364 | | |
1357 | 1365 | | |
1358 | 1366 | | |
| |||
1736 | 1744 | | |
1737 | 1745 | | |
1738 | 1746 | | |
| 1747 | + | |
1739 | 1748 | | |
1740 | 1749 | | |
1741 | 1750 | | |
| |||
4143 | 4152 | | |
4144 | 4153 | | |
4145 | 4154 | | |
| 4155 | + | |
4146 | 4156 | | |
4147 | 4157 | | |
4148 | 4158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1502 | 1502 | | |
1503 | 1503 | | |
1504 | 1504 | | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
1505 | 1510 | | |
1506 | 1511 | | |
1507 | 1512 | | |
| |||
4614 | 4619 | | |
4615 | 4620 | | |
4616 | 4621 | | |
| 4622 | + | |
| 4623 | + | |
| 4624 | + | |
| 4625 | + | |
| 4626 | + | |
| 4627 | + | |
| 4628 | + | |
| 4629 | + | |
| 4630 | + | |
| 4631 | + | |
| 4632 | + | |
4617 | 4633 | | |
4618 | 4634 | | |
4619 | 4635 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
| 276 | + | |
276 | 277 | | |
277 | 278 | | |
278 | 279 | | |
| |||
0 commit comments