Rollup merge of #152236 - davidtwco:compiletest-destabilise-custom-targets, r=scottmcm

compiletest: `-Zunstable-options` for json targets

bootstrap runs compiletest with synthetic custom targets when blessing `mir-opt` tests, but that no longer works after rust-lang/rust#150151/rust-lang/rust#151534 because `-Zunstable-options` is required

Contexts on [Zulips](https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/custom.20targets.20are.20unstable.20and.20require.20.60-Zunstable-options.60).
This commit is contained in:
Matthias Krüger 2026-02-09 18:39:40 +01:00 committed by GitHub
commit 19122c03c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View file

@ -949,7 +949,9 @@ impl TargetCfgs {
// actually be changed with `-C` flags.
for config in query_rustc_output(
config,
&["--print=cfg", "--target", &config.target],
// `-Zunstable-options` is necessary when compiletest is running with custom targets
// (such as synthetic targets used to bless mir-opt tests).
&["-Zunstable-options", "--print=cfg", "--target", &config.target],
Default::default(),
)
.trim()

View file

@ -1670,6 +1670,11 @@ impl<'test> TestCx<'test> {
if self.props.force_host { &*self.config.host } else { &*self.config.target };
compiler.arg(&format!("--target={}", target));
if target.ends_with(".json") {
// `-Zunstable-options` is necessary when compiletest is running with custom targets
// (such as synthetic targets used to bless mir-opt tests).
compiler.arg("-Zunstable-options");
}
}
self.set_revision_flags(&mut compiler);