diff options
| author | Brian Anderson <banderson@mozilla.com> | 2016-10-18 22:42:01 +0000 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2016-10-19 01:23:01 +0000 |
| commit | d3c5905772d0ae1f251a5918fdaa52dbfd7519f2 (patch) | |
| tree | 2b8c263e84c61015048ccb4df86d3ca7bf815e28 /src/libsyntax | |
| parent | 16eeeac783d2ede28e09f2a433c612dea309fe33 (diff) | |
| download | rust-d3c5905772d0ae1f251a5918fdaa52dbfd7519f2.tar.gz rust-d3c5905772d0ae1f251a5918fdaa52dbfd7519f2.zip | |
Allow bootstrapping without a key. Fixes #36548
This will make it easier for packagers to bootstrap rustc when they happen to have a bootstrap compiler with a slightly different version number. It's not ok for anything other than the build system to set this environment variable.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 62b88888fc8..6cdfa35c9c5 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -1317,15 +1317,12 @@ impl UnstableFeatures { pub fn from_environment() -> UnstableFeatures { // Whether this is a feature-staged build, i.e. on the beta or stable channel let disable_unstable_features = option_env!("CFG_DISABLE_UNSTABLE_FEATURES").is_some(); - // The secret key needed to get through the rustc build itself by - // subverting the unstable features lints - let bootstrap_secret_key = option_env!("CFG_BOOTSTRAP_KEY"); - // The matching key to the above, only known by the build system - let bootstrap_provided_key = env::var("RUSTC_BOOTSTRAP_KEY").ok(); - match (disable_unstable_features, bootstrap_secret_key, bootstrap_provided_key) { - (_, Some(ref s), Some(ref p)) if s == p => UnstableFeatures::Cheat, - (true, _, _) => UnstableFeatures::Disallow, - (false, _, _) => UnstableFeatures::Allow + // Whether we should enable unstable features for bootstrapping + let bootstrap = env::var("RUSTC_BOOTSTRAP").is_ok(); + match (disable_unstable_features, bootstrap) { + (_, true) => UnstableFeatures::Cheat, + (true, _) => UnstableFeatures::Disallow, + (false, _) => UnstableFeatures::Allow } } |
