about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2025-08-30 13:11:21 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2025-08-30 13:20:44 -0400
commit2dc57526c276c12de478194dfef0f5af5fbe30cb (patch)
tree43d37e14c3a7cdf6c4a70bab7e955929fd4779a2 /src/bootstrap
parente95db591a4550e28ad92660b753ad85b89271882 (diff)
downloadrust-2dc57526c276c12de478194dfef0f5af5fbe30cb.tar.gz
rust-2dc57526c276c12de478194dfef0f5af5fbe30cb.zip
Use move_file for rename in tracing
This avoids panicking when the source and destinations are on different
filesystems.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/src/utils/tracing.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bootstrap/src/utils/tracing.rs b/src/bootstrap/src/utils/tracing.rs
index 472781ffa73..b1226ed7de7 100644
--- a/src/bootstrap/src/utils/tracing.rs
+++ b/src/bootstrap/src/utils/tracing.rs
@@ -168,7 +168,11 @@ mod inner {
     impl TracingGuard {
         pub fn copy_to_dir(self, dir: &std::path::Path) {
             drop(self.guard);
-            std::fs::rename(&self.chrome_tracing_path, dir.join("chrome-trace.json")).unwrap();
+            crate::utils::helpers::move_file(
+                &self.chrome_tracing_path,
+                dir.join("chrome-trace.json"),
+            )
+            .unwrap();
         }
     }