From b7080e6fd4655d3c9b0c325be84f1b714c99c608 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Fri, 9 Oct 2020 23:15:16 -0400 Subject: [PATCH] Give an error when running `x.py test --stage 0 src/test/ui` --- src/bootstrap/test.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 00522ee6b673c..bda9e0f57841c 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -966,6 +966,15 @@ impl Step for Compiletest { /// compiletest `mode` and `suite` arguments. For example `mode` can be /// "run-pass" or `suite` can be something like `debuginfo`. fn run(self, builder: &Builder<'_>) { + if builder.top_stage == 0 && env::var("COMPILETEST_FORCE_STAGE0").is_err() { + eprintln!("\ +error: `--stage 0` runs compiletest on the beta compiler, not your local changes, and will almost always cause tests to fail +help: use `--stage 1` instead +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`." + ); + std::process::exit(1); + } + let compiler = self.compiler; let target = self.target; let mode = self.mode;