Description
Consider someone working with the standard library and running a UI test for the first time. Their workflow up until now has been
x.py test --stage 0 library/std
This is correct: it builds the standard library once and the compiler zero times. Any changes they make will be reflected in the tests.
Now assume for some reason they have to run a UI test; maybe they change a rustc_on_unimplemented
diagnostic so the .stderr files need to change. They've been using --stage 0 so far, and they really don't want to build the compiler, so they try the same thing on the new test suite:
x.py test --stage 0 src/test/ui
This is incorrect: it builds neither the standard library nor the compiler and runs tests on beta instead.
Unfortunately, the errors this gives are incomprehensible: they say things like
- LL | impl<T: Copy> Foo<T> {
- | ^^^^^^
+ LL | impl<T: std::marker::Copy> Foo<T> {
+ | ^^^^^^^^^^^^^^^^^^^
which give absolutely no indication that you're running the wrong version of the compiler (maybe you'd even think it's caused by your change!)
Instead, x.py should give an error like this:
$ x.py test --stage 0 src/test/ui
error: `--stage 0` is not meaningful for compiletest test suites
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_STAGE_0=1`.