Commit bd9d8ad
authored
Unrolled build for #142267
Rollup merge of #142267 - workingjubilee:debug-assert-less-in-ast-lowering, r=oli-obk
assert more in release in `rustc_ast_lowering`
My understanding of the compiler's architecture is that in the `ast_lowering` crate, we are constructing the HIR as a one-time thing per crate. This is after tokenizing, parsing, resolution, expansion, possible reparsing, reresolution, reexpansion, and so on. In other words, there are many reasons that perf-focused PRs spend a lot of time touching `rustc_parse`, `rustc_expand`, `rustc_ast`, and then `rustc_hir` and "onwards", but `ast_lowering` is a little bit of an odd duck.
In this crate, we have a number of debug assertions. Some are clearly expensive checks that seem like they are prohibitive to run in actual optimized compiler builds, but then there are a number that are simple asserts on integer equalities, `is_empty`, or the like. I believe we should do some of them even in release builds, because the correctness gain is worth the performance cost: almost zero.2 files changed
+18
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
1160 | 1160 | | |
1161 | 1161 | | |
1162 | 1162 | | |
1163 | | - | |
| 1163 | + | |
1164 | 1164 | | |
1165 | 1165 | | |
1166 | 1166 | | |
| |||
1673 | 1673 | | |
1674 | 1674 | | |
1675 | 1675 | | |
1676 | | - | |
1677 | | - | |
| 1676 | + | |
| 1677 | + | |
1678 | 1678 | | |
1679 | 1679 | | |
1680 | 1680 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
526 | | - | |
| 526 | + | |
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
| |||
607 | 607 | | |
608 | 608 | | |
609 | 609 | | |
610 | | - | |
| 610 | + | |
611 | 611 | | |
612 | | - | |
613 | | - | |
| 612 | + | |
| 613 | + | |
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
| |||
918 | 918 | | |
919 | 919 | | |
920 | 920 | | |
921 | | - | |
| 921 | + | |
922 | 922 | | |
923 | 923 | | |
924 | 924 | | |
| |||
956 | 956 | | |
957 | 957 | | |
958 | 958 | | |
959 | | - | |
960 | | - | |
| 959 | + | |
| 960 | + | |
961 | 961 | | |
962 | | - | |
| 962 | + | |
963 | 963 | | |
964 | 964 | | |
965 | 965 | | |
| |||
1438 | 1438 | | |
1439 | 1439 | | |
1440 | 1440 | | |
1441 | | - | |
| 1441 | + | |
1442 | 1442 | | |
1443 | 1443 | | |
1444 | 1444 | | |
| |||
1846 | 1846 | | |
1847 | 1847 | | |
1848 | 1848 | | |
1849 | | - | |
| 1849 | + | |
1850 | 1850 | | |
1851 | 1851 | | |
1852 | 1852 | | |
1853 | 1853 | | |
1854 | | - | |
| 1854 | + | |
1855 | 1855 | | |
1856 | 1856 | | |
1857 | 1857 | | |
1858 | | - | |
| 1858 | + | |
1859 | 1859 | | |
1860 | 1860 | | |
1861 | 1861 | | |
| |||
2285 | 2285 | | |
2286 | 2286 | | |
2287 | 2287 | | |
2288 | | - | |
| 2288 | + | |
2289 | 2289 | | |
2290 | 2290 | | |
2291 | 2291 | | |
| |||
0 commit comments