@@ -338,7 +338,7 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
338
338
339
339
let sysroot = filesearch:: materialize_sysroot ( config. opts . maybe_sysroot . clone ( ) ) ;
340
340
341
- let ( codegen_backend, target_cfg ) = match config. make_codegen_backend {
341
+ let ( codegen_backend, target_override ) = match config. make_codegen_backend {
342
342
None => {
343
343
// Build a target without override, so that it can override the backend if needed
344
344
let target =
@@ -365,36 +365,24 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
365
365
) ;
366
366
}
367
367
368
- // Re-build target with the (potential) override
369
- let target = config:: build_target_config (
370
- & early_dcx,
371
- & config. opts ,
372
- target_override,
373
- & sysroot,
374
- ) ;
375
-
376
- ( backend, target)
368
+ ( backend, target_override)
377
369
}
378
370
Some ( make_codegen_backend) => {
379
371
// N.B. `make_codegen_backend` takes precedence over `target.default_codegen_backend`,
380
372
// which is ignored in this case.
381
-
382
373
let backend = make_codegen_backend ( & config. opts ) ;
383
374
384
375
// target_override is documented to be called before init(), so this is okay
385
376
let target_override = backend. target_override ( & config. opts ) ;
386
377
387
- let target = config:: build_target_config (
388
- & early_dcx,
389
- & config. opts ,
390
- target_override,
391
- & sysroot,
392
- ) ;
393
-
394
- ( backend, target)
378
+ ( backend, target_override)
395
379
}
396
380
} ;
397
381
382
+ // Re-build target with the (potential) override
383
+ let target_cfg =
384
+ config:: build_target_config ( & early_dcx, & config. opts , target_override, & sysroot) ;
385
+
398
386
let temps_dir = config. opts . unstable_opts . temps_dir . as_deref ( ) . map ( PathBuf :: from) ;
399
387
400
388
let bundle = match rustc_errors:: fluent_bundle (
0 commit comments