diff options
| author | Michael Goulet <michael@errs.io> | 2025-02-07 18:35:46 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-02-09 17:11:13 +0000 |
| commit | 4312d7b541cda5444c29b8bec12b72b46e33caff (patch) | |
| tree | 64015ba70fa55c6d6ebbdb6f81e275f0072a251b /library/test | |
| parent | a4e7f8f9bf10588cb5519ae09a15be155499901f (diff) | |
| download | rust-4312d7b541cda5444c29b8bec12b72b46e33caff.tar.gz rust-4312d7b541cda5444c29b8bec12b72b46e33caff.zip | |
Fix pattern matching mode changes and unsafe_op_in_unsafe_fn
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); }; |
