about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbit-aloo <sshourya17@gmail.com>2025-07-30 16:56:38 +0530
committerbit-aloo <sshourya17@gmail.com>2025-08-01 20:27:47 +0530
commit8652d96ff7b58ec491de45d0767b211f631dfbee (patch)
treed507ba0e594a7f03a044f138d14aa668671624ec /src/bootstrap
parentcfc40de9c504c9e05bd9905e3f99011199026ac8 (diff)
downloadrust-8652d96ff7b58ec491de45d0767b211f631dfbee.tar.gz
rust-8652d96ff7b58ec491de45d0767b211f631dfbee.zip
Fix logging of config skip values
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/src/core/config/config.rs55
1 files changed, 27 insertions, 28 deletions
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index 49359afbed6..c3cc920d331 100644
--- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/src/core/config/config.rs
@@ -446,13 +446,23 @@ impl Config {
             enable_bolt_settings: flags_enable_bolt_settings,
             skip_stage0_validation: flags_skip_stage0_validation,
             reproducible_artifact: flags_reproducible_artifact,
-            paths: mut flags_paths,
+            paths: flags_paths,
             set: flags_set,
-            free_args: mut flags_free_args,
+            free_args: flags_free_args,
             ci: flags_ci,
             skip_std_check_if_no_download_rustc: flags_skip_std_check_if_no_download_rustc,
         } = flags;
 
+        #[cfg(feature = "tracing")]
+        span!(
+            target: "CONFIG_HANDLING",
+            tracing::Level::TRACE,
+            "collecting paths and path exclusions",
+            "flags.paths" = ?flags_paths,
+            "flags.skip" = ?flags_skip,
+            "flags.exclude" = ?flags_exclude
+        );
+
         // First initialize the bare minimum that we need for further operation - source directory
         // and execution context.
         let mut config = Config::default_opts();
@@ -576,26 +586,13 @@ impl Config {
             }
         }
 
-        #[cfg(feature = "tracing")]
-        span!(
-            target: "CONFIG_HANDLING",
-            tracing::Level::TRACE,
-            "collecting paths and path exclusions",
-            "flags.paths" = ?flags_paths,
-            "flags.skip" = ?flags_skip,
-            "flags.exclude" = ?flags_exclude
-        );
-
-        #[cfg(feature = "tracing")]
-        span!(
-            target: "CONFIG_HANDLING",
-            tracing::Level::TRACE,
-            "normalizing and combining `flag.skip`/`flag.exclude` paths",
-            "config.skip" = ?config.skip,
-        );
+        let mut paths: Vec<PathBuf> = flags_skip.into_iter().chain(flags_exclude).collect();
+        if let Some(exclude) = exclude {
+            paths.extend(exclude);
+        }
 
-        // Set flags.
-        config.paths = std::mem::take(&mut flags_paths);
+        // Set config values based on flags.
+        config.paths = flags_paths;
         config.include_default_paths = flags_include_default_paths;
         config.rustc_error_format = flags_rustc_error_format;
         config.json_output = flags_json_output;
@@ -608,7 +605,7 @@ impl Config {
         config.keep_stage = flags_keep_stage;
         config.keep_stage_std = flags_keep_stage_std;
         config.color = flags_color;
-        config.free_args = std::mem::take(&mut flags_free_args);
+        config.free_args = flags_free_args;
         config.llvm_profile_use = flags_llvm_profile_use;
         config.llvm_profile_generate = flags_llvm_profile_generate;
         config.enable_bolt_settings = flags_enable_bolt_settings;
@@ -632,12 +629,6 @@ impl Config {
 
         config.change_id = toml.change_id.inner;
 
-        let mut paths: Vec<PathBuf> = flags_skip.into_iter().chain(flags_exclude).collect();
-
-        if let Some(exclude) = exclude {
-            paths.extend(exclude);
-        }
-
         config.skip = paths
             .into_iter()
             .map(|p| {
@@ -652,6 +643,14 @@ impl Config {
             })
             .collect();
 
+        #[cfg(feature = "tracing")]
+        span!(
+            target: "CONFIG_HANDLING",
+            tracing::Level::TRACE,
+            "normalizing and combining `flag.skip`/`flag.exclude` paths",
+            "config.skip" = ?config.skip,
+        );
+
         config.jobs = Some(threads_from_config(jobs.unwrap_or(0)));
         if let Some(build) = build {
             config.host_target = TargetSelection::from_user(&build);