Skip to content

x.py test --stage 0 src/test/ui should give an error #77711

Closed
@jyn514

Description

@jyn514

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`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustA-testsuiteArea: The testsuite used to check the correctness of rustcC-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions