about summary refs log tree commit diff
path: root/src/tools/compiletest
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-04-09 10:07:11 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-04-16 10:58:54 +0000
commitfe18afe48caa890fc343d99a176db8fe8310dbfc (patch)
tree9df59e79767dd98fcfd2e73ea48f982ec8029f90 /src/tools/compiletest
parent63f70b3d104e20289a1a0df82747066c3d85b9a1 (diff)
downloadrust-fe18afe48caa890fc343d99a176db8fe8310dbfc.tar.gz
rust-fe18afe48caa890fc343d99a176db8fe8310dbfc.zip
Unset test env vars before setting new ones.
If you want to override an env var, don't unset it, just set it
Diffstat (limited to 'src/tools/compiletest')
-rw-r--r--src/tools/compiletest/src/runtest.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 38d22fef113..1dd639a8918 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -2173,8 +2173,8 @@ impl<'test> TestCx<'test> {
         let aux_dir = self.aux_output_dir();
         self.build_all_auxiliary(&self.testpaths, &aux_dir, &mut rustc);
 
-        self.props.unset_rustc_env.iter().fold(&mut rustc, Command::env_remove);
         rustc.envs(self.props.rustc_env.clone());
+        self.props.unset_rustc_env.iter().fold(&mut rustc, Command::env_remove);
         self.compose_and_run(
             rustc,
             self.config.compile_lib_path.to_str().unwrap(),
@@ -2220,10 +2220,10 @@ impl<'test> TestCx<'test> {
         );
         aux_cx.build_all_auxiliary(of, &aux_dir, &mut aux_rustc);
 
+        aux_rustc.envs(aux_props.rustc_env.clone());
         for key in &aux_props.unset_rustc_env {
             aux_rustc.env_remove(key);
         }
-        aux_rustc.envs(aux_props.rustc_env.clone());
 
         let (aux_type, crate_type) = if is_bin {
             (AuxType::Bin, Some("bin"))