Skip to content

Commit 1234cf4

Browse files
committed
Unset test env vars before setting new ones.
If you want to override an env var, don't unset it, just set it
1 parent bd12986 commit 1234cf4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tools/compiletest/src/runtest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2137,8 +2137,8 @@ impl<'test> TestCx<'test> {
21372137
let aux_dir = self.aux_output_dir();
21382138
self.build_all_auxiliary(&self.testpaths, &aux_dir, &mut rustc);
21392139

2140-
self.props.unset_rustc_env.iter().fold(&mut rustc, Command::env_remove);
21412140
rustc.envs(self.props.rustc_env.clone());
2141+
self.props.unset_rustc_env.iter().fold(&mut rustc, Command::env_remove);
21422142
self.compose_and_run(
21432143
rustc,
21442144
self.config.compile_lib_path.to_str().unwrap(),
@@ -2184,10 +2184,10 @@ impl<'test> TestCx<'test> {
21842184
);
21852185
aux_cx.build_all_auxiliary(of, &aux_dir, &mut aux_rustc);
21862186

2187+
aux_rustc.envs(aux_props.rustc_env.clone());
21872188
for key in &aux_props.unset_rustc_env {
21882189
aux_rustc.env_remove(key);
21892190
}
2190-
aux_rustc.envs(aux_props.rustc_env.clone());
21912191

21922192
let (aux_type, crate_type) = if is_bin {
21932193
(AuxType::Bin, Some("bin"))

0 commit comments

Comments
 (0)