diff options
Diffstat (limited to 'library/test')
| -rw-r--r-- | library/test/src/lib.rs | 8 |
1 files changed, 6 insertions, 2 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); }; |
