Skip to content

Commit 7450b7e

Browse files
authored
Rollup merge of rust-lang#77776 - jyn514:wrong-way, r=Mark-Simulacrum
Give an error when running `x.py test --stage 0 src/test/ui` The error can be overridden with `COMPILETEST_FORCE_STAGE0=1`. In practice I don't know why anyone would do this. r? @Mark-Simulacrum Closes rust-lang#77711
2 parents 9260b04 + b7080e6 commit 7450b7e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/bootstrap/test.rs

+9
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,15 @@ impl Step for Compiletest {
966966
/// compiletest `mode` and `suite` arguments. For example `mode` can be
967967
/// "run-pass" or `suite` can be something like `debuginfo`.
968968
fn run(self, builder: &Builder<'_>) {
969+
if builder.top_stage == 0 && env::var("COMPILETEST_FORCE_STAGE0").is_err() {
970+
eprintln!("\
971+
error: `--stage 0` runs compiletest on the beta compiler, not your local changes, and will almost always cause tests to fail
972+
help: use `--stage 1` instead
973+
note: if you're sure you want to do this, please open an issue as to why. In the meantime, you can override this with `COMPILETEST_FORCE_STAGE0=1`."
974+
);
975+
std::process::exit(1);
976+
}
977+
969978
let compiler = self.compiler;
970979
let target = self.target;
971980
let mode = self.mode;

0 commit comments

Comments
 (0)