Skip to content

Commit 251e75c

Browse files
committed
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.
1 parent 097261f commit 251e75c

File tree

1 file changed

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

1 file changed

+5
-0
lines changed

Diff for: 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)