about summary refs log tree commit diff
path: root/library/test
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2025-02-10 00:51:54 -0800
committerGitHub <noreply@github.com>2025-02-10 00:51:54 -0800
commit72f0205d281090858cf74d31f4aa3b7e971a3629 (patch)
treec0f0b50ef5b2a88ca82f1fa3944d3d4b96c07e7c /library/test
parentf471ce39fb92e9dd036a062ebaf3689d3c728577 (diff)
parent4312d7b541cda5444c29b8bec12b72b46e33caff (diff)
downloadrust-72f0205d281090858cf74d31f4aa3b7e971a3629.tar.gz
rust-72f0205d281090858cf74d31f4aa3b7e971a3629.zip
Rollup merge of #136705 - compiler-errors:edition-library, r=jhpratt
Some miscellaneous edition-related library tweaks

Some library edition tweaks that can be done separately from upgrading the whole standard library to edition 2024 (which is blocked on getting the submodules upgraded, for example)
Diffstat (limited to 'library/test')
-rw-r--r--library/test/src/lib.rs8
-rw-r--r--library/test/src/term/win.rs2
2 files changed, 7 insertions, 3 deletions
diff --git a/library/test/src/lib.rs b/library/test/src/lib.rs
index 54f7e4ae79f..e523d302866 100644
--- a/library/test/src/lib.rs
+++ b/library/test/src/lib.rs
@@ -184,12 +184,16 @@ pub fn test_main_static_abort(tests: &[&TestDescAndFn]) {
     // If we're being run in SpawnedSecondary mode, run the test here. run_test
     // will then exit the process.
     if let Ok(name) = env::var(SECONDARY_TEST_INVOKER_VAR) {
-        env::remove_var(SECONDARY_TEST_INVOKER_VAR);
+        unsafe {
+            env::remove_var(SECONDARY_TEST_INVOKER_VAR);
+        }
 
         // Convert benchmarks to tests if we're not benchmarking.
         let mut tests = tests.iter().map(make_owned_test).collect::<Vec<_>>();
         if env::var(SECONDARY_TEST_BENCH_BENCHMARKS_VAR).is_ok() {
-            env::remove_var(SECONDARY_TEST_BENCH_BENCHMARKS_VAR);
+            unsafe {
+                env::remove_var(SECONDARY_TEST_BENCH_BENCHMARKS_VAR);
+            }
         } else {
             tests = convert_benchmarks_to_tests(tests);
         };
diff --git a/library/test/src/term/win.rs b/library/test/src/term/win.rs
index c77e6aac478..62e5c43ea27 100644
--- a/library/test/src/term/win.rs
+++ b/library/test/src/term/win.rs
@@ -52,7 +52,7 @@ struct CONSOLE_SCREEN_BUFFER_INFO {
 
 #[allow(non_snake_case)]
 #[link(name = "kernel32")]
-extern "system" {
+unsafe extern "system" {
     fn SetConsoleTextAttribute(handle: HANDLE, attr: WORD) -> BOOL;
     fn GetStdHandle(which: DWORD) -> HANDLE;
     fn GetConsoleScreenBufferInfo(handle: HANDLE, info: *mut CONSOLE_SCREEN_BUFFER_INFO) -> BOOL;