@@ -446,13 +446,23 @@ impl Config {
446
446
enable_bolt_settings : flags_enable_bolt_settings,
447
447
skip_stage0_validation : flags_skip_stage0_validation,
448
448
reproducible_artifact : flags_reproducible_artifact,
449
- paths : mut flags_paths,
449
+ paths : flags_paths,
450
450
set : flags_set,
451
- free_args : mut flags_free_args,
451
+ free_args : flags_free_args,
452
452
ci : flags_ci,
453
453
skip_std_check_if_no_download_rustc : flags_skip_std_check_if_no_download_rustc,
454
454
} = flags;
455
455
456
+ #[ cfg( feature = "tracing" ) ]
457
+ span ! (
458
+ target: "CONFIG_HANDLING" ,
459
+ tracing:: Level :: TRACE ,
460
+ "collecting paths and path exclusions" ,
461
+ "flags.paths" = ?flags_paths,
462
+ "flags.skip" = ?flags_skip,
463
+ "flags.exclude" = ?flags_exclude
464
+ ) ;
465
+
456
466
// First initialize the bare minimum that we need for further operation - source directory
457
467
// and execution context.
458
468
let mut config = Config :: default_opts ( ) ;
@@ -576,26 +586,13 @@ impl Config {
576
586
}
577
587
}
578
588
579
- #[ cfg( feature = "tracing" ) ]
580
- span ! (
581
- target: "CONFIG_HANDLING" ,
582
- tracing:: Level :: TRACE ,
583
- "collecting paths and path exclusions" ,
584
- "flags.paths" = ?flags_paths,
585
- "flags.skip" = ?flags_skip,
586
- "flags.exclude" = ?flags_exclude
587
- ) ;
588
-
589
- #[ cfg( feature = "tracing" ) ]
590
- span ! (
591
- target: "CONFIG_HANDLING" ,
592
- tracing:: Level :: TRACE ,
593
- "normalizing and combining `flag.skip`/`flag.exclude` paths" ,
594
- "config.skip" = ?config. skip,
595
- ) ;
589
+ let mut paths: Vec < PathBuf > = flags_skip. into_iter ( ) . chain ( flags_exclude) . collect ( ) ;
590
+ if let Some ( exclude) = exclude {
591
+ paths. extend ( exclude) ;
592
+ }
596
593
597
- // Set flags.
598
- config. paths = std :: mem :: take ( & mut flags_paths) ;
594
+ // Set config values based on flags.
595
+ config. paths = flags_paths;
599
596
config. include_default_paths = flags_include_default_paths;
600
597
config. rustc_error_format = flags_rustc_error_format;
601
598
config. json_output = flags_json_output;
@@ -608,7 +605,7 @@ impl Config {
608
605
config. keep_stage = flags_keep_stage;
609
606
config. keep_stage_std = flags_keep_stage_std;
610
607
config. color = flags_color;
611
- config. free_args = std :: mem :: take ( & mut flags_free_args) ;
608
+ config. free_args = flags_free_args;
612
609
config. llvm_profile_use = flags_llvm_profile_use;
613
610
config. llvm_profile_generate = flags_llvm_profile_generate;
614
611
config. enable_bolt_settings = flags_enable_bolt_settings;
@@ -632,12 +629,6 @@ impl Config {
632
629
633
630
config. change_id = toml. change_id . inner ;
634
631
635
- let mut paths: Vec < PathBuf > = flags_skip. into_iter ( ) . chain ( flags_exclude) . collect ( ) ;
636
-
637
- if let Some ( exclude) = exclude {
638
- paths. extend ( exclude) ;
639
- }
640
-
641
632
config. skip = paths
642
633
. into_iter ( )
643
634
. map ( |p| {
@@ -652,6 +643,14 @@ impl Config {
652
643
} )
653
644
. collect ( ) ;
654
645
646
+ #[ cfg( feature = "tracing" ) ]
647
+ span ! (
648
+ target: "CONFIG_HANDLING" ,
649
+ tracing:: Level :: TRACE ,
650
+ "normalizing and combining `flag.skip`/`flag.exclude` paths" ,
651
+ "config.skip" = ?config. skip,
652
+ ) ;
653
+
655
654
config. jobs = Some ( threads_from_config ( jobs. unwrap_or ( 0 ) ) ) ;
656
655
if let Some ( build) = build {
657
656
config. host_target = TargetSelection :: from_user ( & build) ;
0 commit comments