Skip to content

Commit b0ea4e7

Browse files
committed
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.
1 parent 30f3860 commit b0ea4e7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/bootstrap/bootstrap.py

-1
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,6 @@ def bootstrap(help_triggered):
11711171
env = os.environ.copy()
11721172
env["BOOTSTRAP_PARENT_ID"] = str(os.getpid())
11731173
env["BOOTSTRAP_PYTHON"] = sys.executable
1174-
env["RUSTC_BOOTSTRAP"] = '1'
11751174
if build.rustc_commit is not None:
11761175
env["BOOTSTRAP_DOWNLOAD_RUSTC"] = '1'
11771176
run(args, env=env, verbose=build.verbose, is_bootstrap=True)

src/bootstrap/doc.rs

+4
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,10 @@ impl Step for RustcBook {
881881
if self.validate {
882882
cmd.arg("--validate");
883883
}
884+
if !builder.unstable_features() {
885+
// We need to validate nightly features, even on the stable channel.
886+
cmd.env("RUSTC_BOOTSTRAP", "1");
887+
}
884888
// If the lib directories are in an unusual location (changed in
885889
// config.toml), then this needs to explicitly update the dylib search
886890
// path.

0 commit comments

Comments
 (0)