Commit a729c24
committed
Auto merge of #142267 - workingjubilee:debug-assert-less-in-ast-lowering, r=<try>
[EXPERIMENTAL] assert in release builds 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 simple integer equalities. I am curious if the latter introduce a serious problem if we simply *do* them.
r? `@ghost`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 | |
|---|---|---|---|
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
506 | | - | |
| 506 | + | |
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
| |||
586 | 586 | | |
587 | 587 | | |
588 | 588 | | |
589 | | - | |
| 589 | + | |
590 | 590 | | |
591 | | - | |
592 | | - | |
| 591 | + | |
| 592 | + | |
593 | 593 | | |
594 | 594 | | |
595 | 595 | | |
| |||
891 | 891 | | |
892 | 892 | | |
893 | 893 | | |
894 | | - | |
| 894 | + | |
895 | 895 | | |
896 | 896 | | |
897 | 897 | | |
| |||
915 | 915 | | |
916 | 916 | | |
917 | 917 | | |
918 | | - | |
919 | | - | |
| 918 | + | |
| 919 | + | |
920 | 920 | | |
921 | | - | |
| 921 | + | |
922 | 922 | | |
923 | 923 | | |
924 | 924 | | |
| |||
1397 | 1397 | | |
1398 | 1398 | | |
1399 | 1399 | | |
1400 | | - | |
| 1400 | + | |
1401 | 1401 | | |
1402 | 1402 | | |
1403 | 1403 | | |
| |||
1805 | 1805 | | |
1806 | 1806 | | |
1807 | 1807 | | |
1808 | | - | |
| 1808 | + | |
1809 | 1809 | | |
1810 | 1810 | | |
1811 | 1811 | | |
1812 | 1812 | | |
1813 | | - | |
| 1813 | + | |
1814 | 1814 | | |
1815 | 1815 | | |
1816 | 1816 | | |
1817 | | - | |
| 1817 | + | |
1818 | 1818 | | |
1819 | 1819 | | |
1820 | 1820 | | |
| |||
2244 | 2244 | | |
2245 | 2245 | | |
2246 | 2246 | | |
2247 | | - | |
| 2247 | + | |
2248 | 2248 | | |
2249 | 2249 | | |
2250 | 2250 | | |
| |||
0 commit comments