Miscellaneous testing-related info

RUSTC_BOOTSTRAP and stability

This is a bootstrap/compiler implementation detail, but it can also be useful for testing:

Note that setting RUSTC_BOOTSTRAP in ui tests (e.g. via //@ rustc-env) is pointless since ui tests inherit the bootstrap env var from bootstrap (so it’s set to 1 by default), and since compiletest itself passes -Z flags (so -1 breaks the test). To test stable-only behavior, you need to write a run-make test instead.

For run-make/run-make-cargo tests, //@ rustc-env is not supported. You can do something like the following for individual rustc invocations.

use run_make_support::rustc;

fn main() {
    rustc()
        // Pretend that I am very stable
        .env("RUSTC_BOOTSTRAP", "-1")
        //...
        .run();
}