Skip to content

Commit 99b048c

Browse files
committed
compiletest: update to Edition 2024
1 parent 934880f commit 99b048c

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

Diff for: src/tools/compiletest/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "compiletest"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[lib]
77
doctest = false

Diff for: src/tools/compiletest/src/debuggers.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ pub(crate) fn configure_gdb(config: &Config) -> Option<Arc<Config>> {
4040
//
4141
// we should figure out how to lift this restriction! (run them all
4242
// on different ports allocated dynamically).
43-
env::set_var("RUST_TEST_THREADS", "1");
43+
//
44+
// SAFETY: at this point we are still single-threaded.
45+
unsafe { env::set_var("RUST_TEST_THREADS", "1") };
4446
}
4547

4648
Some(Arc::new(Config { debugger: Some(Debugger::Gdb), ..config.clone() }))

Diff for: src/tools/compiletest/src/lib.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -529,10 +529,14 @@ pub fn run_tests(config: Arc<Config>) {
529529
}
530530
// Prevent issue #21352 UAC blocking .exe containing 'patch' etc. on Windows
531531
// If #11207 is resolved (adding manifest to .exe) this becomes unnecessary
532-
env::set_var("__COMPAT_LAYER", "RunAsInvoker");
533-
534-
// Let tests know which target they're running as
535-
env::set_var("TARGET", &config.target);
532+
//
533+
// SAFETY: at this point we're still single-threaded.
534+
unsafe { env::set_var("__COMPAT_LAYER", "RunAsInvoker") };
535+
536+
// Let tests know which target they're running as.
537+
//
538+
// SAFETY: at this point we're still single-threaded.
539+
unsafe { env::set_var("TARGET", &config.target) };
536540

537541
let mut configs = Vec::new();
538542
if let Mode::DebugInfo = config.mode {

0 commit comments

Comments
 (0)