From ce6adccdade1ec29bff031c296c5ae0d80ab0446 Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Sun, 12 Mar 2023 00:23:28 -0800 Subject: [PATCH] Prevent stable `libtest` from supporting `-Zunstable-options` --- src/bootstrap/compile.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 8b80dfc0f9b97..54971af644c28 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -339,6 +339,12 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car "" }; + // `libtest` uses this to know whether or not to support + // `-Zunstable-options`. + if !builder.unstable_features() { + cargo.env("CFG_DISABLE_UNSTABLE_FEATURES", "1"); + } + let mut features = String::new(); // Cranelift doesn't support `asm`.