Mention RUSTC_BOOTSTRAP for misc testing by jieyouxu · Pull Request #2136 · rust-lang/rustc-dev-guide (original) (raw)

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Nov 18, 2024

@rust-timer

Rollup merge of rust-lang#132993 - jieyouxu:i_am_very_stable, r=chenyukang

Make rustc consider itself a stable compiler when RUSTC_BOOTSTRAP=-1

Addresses rust-lang#123404 to allow test writers to specify //@ rustc-env:RUSTC_BOOTSTRAP=-1 to have a given rustc consider itself a stable rustc. This is only intended for testing usages.

I did not use RUSTC_BOOTSTRAP=0 because that can be confusing, i.e. one might think that means "not bootstrapping", but "forcing a given rustc to consider itself a stable compiler" is a different use case.

I also added a specific test to check RUSTC_BOOTSTRAP's various values and how that interacts with rustc's stability story w.r.t. features and cli flags.

Noticed when trying to write a test for enabling ICE file dumping on stable.

Dunno if this needs a compiler FCP or MCP, but I can file an MCP or ask someone to start an FCP if needed. Note that RUSTC_BOOTSTRAP is a perma-unstable env var and has no stability guarantees (heh) whatsoever. This does not affect bootstrapping because bootstrap never sets RUSTC_BOOTSTRAP=-1. If someone does set that when bootstrapping, it is considered PEBKAC.

Accompanying dev-guide PR: rust-lang/rustc-dev-guide#2136

cc @estebank and @rust-lang/wg-diagnostics for FYI