Skip to content

Commit fe18afe

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 63f70b3 commit fe18afe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tools/compiletest/src/runtest.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2173,8 +2173,8 @@ impl<'test> TestCx<'test> {
21732173
let aux_dir = self.aux_output_dir();
21742174
self.build_all_auxiliary(&self.testpaths, &aux_dir, &mut rustc);
21752175

2176-
self.props.unset_rustc_env.iter().fold(&mut rustc, Command::env_remove);
21772176
rustc.envs(self.props.rustc_env.clone());
2177+
self.props.unset_rustc_env.iter().fold(&mut rustc, Command::env_remove);
21782178
self.compose_and_run(
21792179
rustc,
21802180
self.config.compile_lib_path.to_str().unwrap(),
@@ -2220,10 +2220,10 @@ impl<'test> TestCx<'test> {
22202220
);
22212221
aux_cx.build_all_auxiliary(of, &aux_dir, &mut aux_rustc);
22222222

2223+
aux_rustc.envs(aux_props.rustc_env.clone());
22232224
for key in &aux_props.unset_rustc_env {
22242225
aux_rustc.env_remove(key);
22252226
}
2226-
aux_rustc.envs(aux_props.rustc_env.clone());
22272227

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

0 commit comments

Comments
 (0)