From 85633125c7616d00e3c3a33eb356e26540b8a438 Mon Sep 17 00:00:00 2001 From: Deepesh Varatharajan Date: Wed, 8 Apr 2026 08:46:43 -0700 Subject: [PATCH] compiletest: pass -Zunstable-options for unpretty and no-codegen paths Unconditionally pass -Zunstable-options in the `unpretty` and `-Zno-codegen` (typecheck) paths in compiletest. This ensures custom targets resolved via RUST_TARGET_PATH work consistently. This is primarily needed when using non-built-in targets without a .json extension. Signed-off-by: Deepesh Varatharajan --- src/tools/compiletest/src/runtest.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 5fc3dbbfbc545..6b5147cea6626 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -452,6 +452,7 @@ impl<'test> TestCx<'test> { rustc .arg(input) .args(&["-Z", &format!("unpretty={}", pretty_type)]) + .arg("-Zunstable-options") .args(&["--target", &self.config.target]) .arg("-L") .arg(&aux_dir) @@ -557,6 +558,7 @@ impl<'test> TestCx<'test> { rustc .arg("-") .arg("-Zno-codegen") + .arg("-Zunstable-options") .arg("--out-dir") .arg(&out_dir) .arg(&format!("--target={}", target))