Skip to content

Commit a52c41a

Browse files
authored
Rollup merge of #106767 - chbaker0:disable-unstable-features, r=Mark-Simulacrum
Allow setting CFG_DISABLE_UNSTABLE_FEATURES to 0 Two locations check whether this build-time environment variable is defined. Allowing it to be explicitly disabled with a "0" value is useful, especially for integrating with external build systems.
2 parents 3223711 + c86f71f commit a52c41a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/src/cli.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ fn parse_opts_impl(matches: getopts::Matches) -> OptRes {
309309
// FIXME: Copied from librustc_ast until linkage errors are resolved. Issue #47566
310310
fn is_nightly() -> bool {
311311
// Whether this is a feature-staged build, i.e., on the beta or stable channel
312-
let disable_unstable_features = option_env!("CFG_DISABLE_UNSTABLE_FEATURES").is_some();
312+
let disable_unstable_features =
313+
option_env!("CFG_DISABLE_UNSTABLE_FEATURES").map(|s| s != "0").unwrap_or(false);
313314
// Whether we should enable unstable features for bootstrapping
314315
let bootstrap = env::var("RUSTC_BOOTSTRAP").is_ok();
315316

0 commit comments

Comments
 (0)