about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarijn Schouten <mhkbst@gmail.com>2025-07-10 08:14:05 +0000
committerMarijn Schouten <mhkbst@gmail.com>2025-07-11 05:39:27 +0000
commit9bd4c90cafa65d6aee8295d776af314098f33bcc (patch)
tree73d994037f47ef3738c94d454655855ba30d645a
parenta4e994ea43671bfe2065aed3a19a20fa04427750 (diff)
downloadrust-9bd4c90cafa65d6aee8295d776af314098f33bcc.tar.gz
rust-9bd4c90cafa65d6aee8295d776af314098f33bcc.zip
tidy: move to edition 2024
-rw-r--r--src/tools/tidy/Cargo.toml2
-rw-r--r--src/tools/tidy/src/main.rs9
2 files changed, 6 insertions, 5 deletions
diff --git a/src/tools/tidy/Cargo.toml b/src/tools/tidy/Cargo.toml
index 4835c220210..d995106ae02 100644
--- a/src/tools/tidy/Cargo.toml
+++ b/src/tools/tidy/Cargo.toml
@@ -1,7 +1,7 @@
 [package]
 name = "tidy"
 version = "0.1.0"
-edition = "2021"
+edition = "2024"
 autobins = false
 
 [dependencies]
diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs
index 1eb5485f2b8..a67f7a511b5 100644
--- a/src/tools/tidy/src/main.rs
+++ b/src/tools/tidy/src/main.rs
@@ -15,11 +15,12 @@ use std::{env, process};
 use tidy::*;
 
 fn main() {
-    // Running Cargo will read the libstd Cargo.toml
+    // Enable nightly, because Cargo will read the libstd Cargo.toml
     // which uses the unstable `public-dependency` feature.
-    //
-    // `setenv` might not be thread safe, so run it before using multiple threads.
-    env::set_var("RUSTC_BOOTSTRAP", "1");
+    // SAFETY: no other threads have been spawned
+    unsafe {
+        env::set_var("RUSTC_BOOTSTRAP", "1");
+    }
 
     let root_path: PathBuf = env::args_os().nth(1).expect("need path to root of repo").into();
     let cargo: PathBuf = env::args_os().nth(2).expect("need path to cargo").into();