Skip to content

Commit b7080e6

Browse files
committed
Give an error when running x.py test --stage 0 src/test/ui
1 parent c38f001 commit b7080e6

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)