Skip to content

Commit 8b24d47

Browse files
authored
Unrolled build for #152236
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 #150151/#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).
2 parents 71dc761 + 43e5203 commit 8b24d47

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/tools/compiletest/src/common.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,9 @@ impl TargetCfgs {
949949
// actually be changed with `-C` flags.
950950
for config in query_rustc_output(
951951
config,
952-
&["--print=cfg", "--target", &config.target],
952+
// `-Zunstable-options` is necessary when compiletest is running with custom targets
953+
// (such as synthetic targets used to bless mir-opt tests).
954+
&["-Zunstable-options", "--print=cfg", "--target", &config.target],
953955
Default::default(),
954956
)
955957
.trim()

src/tools/compiletest/src/runtest.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,6 +1670,11 @@ impl<'test> TestCx<'test> {
16701670
if self.props.force_host { &*self.config.host } else { &*self.config.target };
16711671

16721672
compiler.arg(&format!("--target={}", target));
1673+
if target.ends_with(".json") {
1674+
// `-Zunstable-options` is necessary when compiletest is running with custom targets
1675+
// (such as synthetic targets used to bless mir-opt tests).
1676+
compiler.arg("-Zunstable-options");
1677+
}
16731678
}
16741679
self.set_revision_flags(&mut compiler);
16751680

0 commit comments

Comments
 (0)