From 9bd4c90cafa65d6aee8295d776af314098f33bcc Mon Sep 17 00:00:00 2001 From: Marijn Schouten Date: Thu, 10 Jul 2025 08:14:05 +0000 Subject: [PATCH] tidy: move to edition 2024 --- src/tools/tidy/Cargo.toml | 2 +- src/tools/tidy/src/main.rs | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/tools/tidy/Cargo.toml b/src/tools/tidy/Cargo.toml index 4835c2202104..d995106ae025 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 1eb5485f2b86..a67f7a511b59 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();