@@ -1142,43 +1142,29 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
1142
1142
1143
1143
assert_module_sources:: assert_module_sources ( tcx, & modules) ;
1144
1144
1145
- // Instantiate translation items without filling out definitions yet...
1146
1145
for ccx in crate_context_list. iter_need_trans ( ) {
1147
1146
let dep_node = ccx. codegen_unit ( ) . work_product_dep_node ( ) ;
1148
1147
tcx. dep_graph . with_task ( dep_node,
1149
1148
ccx,
1150
1149
AssertDepGraphSafe ( symbol_map. clone ( ) ) ,
1151
1150
trans_decl_task) ;
1152
1151
1152
+
1153
1153
fn trans_decl_task < ' a , ' tcx > ( ccx : CrateContext < ' a , ' tcx > ,
1154
1154
symbol_map : AssertDepGraphSafe < Rc < SymbolMap < ' tcx > > > ) {
1155
+ // Instantiate translation items without filling out definitions yet...
1156
+
1155
1157
// FIXME(#40304): Instead of this, the symbol-map should be an
1156
1158
// on-demand thing that we compute.
1157
1159
let AssertDepGraphSafe ( symbol_map) = symbol_map;
1158
1160
let cgu = ccx. codegen_unit ( ) ;
1159
1161
let trans_items = cgu. items_in_deterministic_order ( ccx. tcx ( ) , & symbol_map) ;
1160
- for ( trans_item, linkage) in trans_items {
1162
+ for & ( trans_item, linkage) in & trans_items {
1161
1163
trans_item. predefine ( & ccx, linkage) ;
1162
1164
}
1163
- }
1164
- }
1165
1165
1166
- // ... and now that we have everything pre-defined, fill out those definitions.
1167
- for ccx in crate_context_list. iter_need_trans ( ) {
1168
- let dep_node = ccx. codegen_unit ( ) . work_product_dep_node ( ) ;
1169
- tcx. dep_graph . with_task ( dep_node,
1170
- ccx,
1171
- AssertDepGraphSafe ( symbol_map. clone ( ) ) ,
1172
- trans_def_task) ;
1173
-
1174
- fn trans_def_task < ' a , ' tcx > ( ccx : CrateContext < ' a , ' tcx > ,
1175
- symbol_map : AssertDepGraphSafe < Rc < SymbolMap < ' tcx > > > ) {
1176
- // FIXME(#40304): Instead of this, the symbol-map should be an
1177
- // on-demand thing that we compute.
1178
- let AssertDepGraphSafe ( symbol_map) = symbol_map;
1179
- let cgu = ccx. codegen_unit ( ) ;
1180
- let trans_items = cgu. items_in_deterministic_order ( ccx. tcx ( ) , & symbol_map) ;
1181
- for ( trans_item, _) in trans_items {
1166
+ // ... and now that we have everything pre-defined, fill out those definitions.
1167
+ for & ( trans_item, _) in & trans_items {
1182
1168
trans_item. define ( & ccx) ;
1183
1169
}
1184
1170
0 commit comments