Skip to content

Commit 19fb579

Browse files
committed
compiletest: -Zunstable-options for json targets
1 parent 035b01b commit 19fb579

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 tests (such
953+
// 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 tests
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)