Skip to content

Commit

Permalink
Rollup merge of rust-lang#77776 - jyn514:wrong-way, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
 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
  • Loading branch information
JohnTitor authored Oct 13, 2020
2 parents 9260b04 + b7080e6 commit 7450b7e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7450b7e

Please sign in to comment.