Commit e7b44d8
committed
Auto merge of #38053 - eddyb:lazy-9, r=nikomatsakis
[9/n] rustc: move type information out of AdtDef and TraitDef.
_This is part of a series ([prev](rust-lang/rust#37688) | [next]()) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well.
If any motivation is unclear, please ask for additional PR description clarifications or code comments._
<hr>
Both `AdtDef` and `TraitDef` contained type information (field types, generics and predicates) which was required to create them, preventing their use before that type information exists, or in the case of field types, *mutation* was required, leading to a variance-magicking implementation of `ivar`s.
This PR takes that information out and the resulting cleaner setup could even eventually end up merged with HIR, because, just like `AssociatedItem` before it, there's no dependency on types anymore.
(With one exception, variant discriminants should probably be moved into their own map later.)2 files changed
+8
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | 154 | | |
156 | 155 | | |
157 | | - | |
| 156 | + | |
158 | 157 | | |
159 | 158 | | |
160 | 159 | | |
161 | | - | |
| 160 | + | |
162 | 161 | | |
163 | 162 | | |
164 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1395 | 1395 | | |
1396 | 1396 | | |
1397 | 1397 | | |
1398 | | - | |
1399 | 1398 | | |
1400 | | - | |
| 1399 | + | |
1401 | 1400 | | |
1402 | 1401 | | |
1403 | 1402 | | |
| |||
1927 | 1926 | | |
1928 | 1927 | | |
1929 | 1928 | | |
1930 | | - | |
| 1929 | + | |
1931 | 1930 | | |
1932 | 1931 | | |
1933 | 1932 | | |
| |||
1937 | 1936 | | |
1938 | 1937 | | |
1939 | 1938 | | |
1940 | | - | |
| 1939 | + | |
1941 | 1940 | | |
1942 | 1941 | | |
1943 | 1942 | | |
| |||
2084 | 2083 | | |
2085 | 2084 | | |
2086 | 2085 | | |
2087 | | - | |
| 2086 | + | |
2088 | 2087 | | |
2089 | 2088 | | |
2090 | 2089 | | |
2091 | 2090 | | |
2092 | 2091 | | |
2093 | | - | |
| 2092 | + | |
2094 | 2093 | | |
2095 | 2094 | | |
2096 | 2095 | | |
| |||
2106 | 2105 | | |
2107 | 2106 | | |
2108 | 2107 | | |
2109 | | - | |
| 2108 | + | |
2110 | 2109 | | |
2111 | 2110 | | |
2112 | 2111 | | |
| |||
0 commit comments