about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-11-10 10:05:28 +0000
committerbors <bors@rust-lang.org>2023-11-10 10:05:28 +0000
commit3d0e99d632f4bbeaab979d32bd8700f170ddb6b1 (patch)
tree9bcf3790a408e9d3baf3f655421bfc15cd50dbcd
parent17d0a45f5df31f218b84c3275bb05c3227348b5b (diff)
parentfdb72795d1e4f92fd05a86e62fe5819190a1f5a8 (diff)
downloadrust-3d0e99d632f4bbeaab979d32bd8700f170ddb6b1.tar.gz
rust-3d0e99d632f4bbeaab979d32bd8700f170ddb6b1.zip
Auto merge of #117765 - onur-ozkan:fix-117762, r=clubby789
enable unstable feature on `x clean [PATH]`

Since https://github.com/rust-lang/rust/pull/111076 enables unstable cargo feature (`public-dependency`), we need to ensure that unstable features are enabled before reading libstd Cargo.toml.

Fixes #117762

cc `@Nilstrieb`
-rw-r--r--src/bootstrap/src/core/build_steps/clean.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bootstrap/src/core/build_steps/clean.rs b/src/bootstrap/src/core/build_steps/clean.rs
index 77ffc27281f..cbb6b5f4648 100644
--- a/src/bootstrap/src/core/build_steps/clean.rs
+++ b/src/bootstrap/src/core/build_steps/clean.rs
@@ -68,6 +68,12 @@ macro_rules! clean_crate_tree {
                 let compiler = self.compiler;
                 let target = compiler.host;
                 let mut cargo = builder.bare_cargo(compiler, $mode, target, "clean");
+
+                // Since https://github.com/rust-lang/rust/pull/111076 enables
+                // unstable cargo feature (`public-dependency`), we need to ensure
+                // that unstable features are enabled before reading libstd Cargo.toml.
+                cargo.env("RUSTC_BOOTSTRAP", "1");
+
                 for krate in &*self.crates {
                     cargo.arg("-p");
                     cargo.arg(krate);