about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorJoshua Nelson <jnelson@cloudflare.com>2022-05-22 08:30:56 -0500
committerJoshua Nelson <jnelson@cloudflare.com>2022-05-22 08:31:50 -0500
commitb0ea4e74cbcb7e4e42f622cda098b95e583f62d9 (patch)
treef5e1ca89da57e1d696c95ccea2f7d2bd1322f07f /src/bootstrap
parent30f386087564243ab88a93c984c265290a31580b (diff)
downloadrust-b0ea4e74cbcb7e4e42f622cda098b95e583f62d9.tar.gz
rust-b0ea4e74cbcb7e4e42f622cda098b95e583f62d9.zip
Avoid accidentally enabling unstable features in compilers (take 2)
This allows rustbuild to control whether crates can use nightly features or not.
It also prevents rustbuild from using nightly features itself.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/bootstrap.py1
-rw-r--r--src/bootstrap/doc.rs4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index e38a574ca23..7a684c89fe3 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -1171,7 +1171,6 @@ def bootstrap(help_triggered):
     env = os.environ.copy()
     env["BOOTSTRAP_PARENT_ID"] = str(os.getpid())
     env["BOOTSTRAP_PYTHON"] = sys.executable
-    env["RUSTC_BOOTSTRAP"] = '1'
     if build.rustc_commit is not None:
         env["BOOTSTRAP_DOWNLOAD_RUSTC"] = '1'
     run(args, env=env, verbose=build.verbose, is_bootstrap=True)
diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs
index fcef784d2d1..be6655ddb61 100644
--- a/src/bootstrap/doc.rs
+++ b/src/bootstrap/doc.rs
@@ -881,6 +881,10 @@ impl Step for RustcBook {
         if self.validate {
             cmd.arg("--validate");
         }
+        if !builder.unstable_features() {
+            // We need to validate nightly features, even on the stable channel.
+            cmd.env("RUSTC_BOOTSTRAP", "1");
+        }
         // If the lib directories are in an unusual location (changed in
         // config.toml), then this needs to explicitly update the dylib search
         // path.