Skip to content

Commit 187d44b

Browse files
authored
Rollup merge of #118059 - Nilstrieb:unset-cargo, r=dtolnay
Explicitly unset $CARGO for compiletest Some UI tests trigger behavior in rustc where it reads $CARGO and changes behavior if it exists. To make the tests work that rely on it not being set, make sure it is not set. By default, this is not set, but people may do weird hacks that cause it to be set. closes #118058
2 parents 6bb671e + 251e75c commit 187d44b

File tree

1 file changed

+5
-0
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+5
-0
lines changed

src/bootstrap/src/core/build_steps/test.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1932,6 +1932,11 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
19321932
}
19331933
}
19341934
}
1935+
1936+
// Some UI tests trigger behavior in rustc where it reads $CARGO and changes behavior if it exists.
1937+
// To make the tests work that rely on it not being set, make sure it is not set.
1938+
cmd.env_remove("CARGO");
1939+
19351940
cmd.env("RUSTC_BOOTSTRAP", "1");
19361941
// Override the rustc version used in symbol hashes to reduce the amount of normalization
19371942
// needed when diffing test output.

0 commit comments

Comments
 (0)