@@ -180,22 +180,6 @@ impl<'tcx> Queries<'tcx> {
180
180
} )
181
181
}
182
182
183
- pub fn ongoing_codegen ( & ' tcx self ) -> Result < Box < dyn Any > > {
184
- self . global_ctxt ( ) ?. enter ( |tcx| {
185
- // Don't do code generation if there were any errors
186
- self . compiler . sess . compile_status ( ) ?;
187
-
188
- // If we have any delayed bugs, for example because we created TyKind::Error earlier,
189
- // it's likely that codegen will only cause more ICEs, obscuring the original problem
190
- self . compiler . sess . diagnostic ( ) . flush_delayed ( ) ;
191
-
192
- // Hook for UI tests.
193
- Self :: check_for_rustc_errors_attr ( tcx) ;
194
-
195
- Ok ( passes:: start_codegen ( & * self . compiler . codegen_backend , tcx) )
196
- } )
197
- }
198
-
199
183
/// Check for the `#[rustc_error]` annotation, which forces an error in codegen. This is used
200
184
/// to write UI tests that actually test that compilation succeeds without reporting
201
185
/// an error.
@@ -230,8 +214,18 @@ impl<'tcx> Queries<'tcx> {
230
214
}
231
215
}
232
216
233
- pub fn linker ( & ' tcx self , ongoing_codegen : Box < dyn Any > ) -> Result < Linker > {
217
+ pub fn codegen_and_build_linker ( & ' tcx self ) -> Result < Linker > {
234
218
self . global_ctxt ( ) ?. enter ( |tcx| {
219
+ // Don't do code generation if there were any errors
220
+ self . compiler . sess . compile_status ( ) ?;
221
+
222
+ // If we have any delayed bugs, for example because we created TyKind::Error earlier,
223
+ // it's likely that codegen will only cause more ICEs, obscuring the original problem
224
+ self . compiler . sess . diagnostic ( ) . flush_delayed ( ) ;
225
+
226
+ // Hook for UI tests.
227
+ Self :: check_for_rustc_errors_attr ( tcx) ;
228
+
235
229
Ok ( Linker {
236
230
dep_graph : tcx. dep_graph . clone ( ) ,
237
231
output_filenames : tcx. output_filenames ( ( ) ) . clone ( ) ,
@@ -240,7 +234,7 @@ impl<'tcx> Queries<'tcx> {
240
234
} else {
241
235
None
242
236
} ,
243
- ongoing_codegen,
237
+ ongoing_codegen : passes :: start_codegen ( & * self . compiler . codegen_backend , tcx ) ,
244
238
} )
245
239
} )
246
240
}
0 commit comments