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
This commit is contained in:
Nilstrieb 2023-11-21 09:06:28 +01:00 committed by GitHub
commit 187d44bfe3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1932,6 +1932,11 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
}
}
}
// 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.
cmd.env_remove("CARGO");
cmd.env("RUSTC_BOOTSTRAP", "1");
// Override the rustc version used in symbol hashes to reduce the amount of normalization
// needed when diffing test output.