Skip to content

Commit 5f387bc

Browse files
committed
fix(libstd): switch to -Zpublic-dependency cargo flag
rust-lang/cargo#13340 switches the featurte gate for public-dependency from `cargo-features` in Cargo.toml to CLI flag `-Zpublic-dependency`. `cargo-features` will continue working for 1 to 2 release cycles as a transition period, to make sure that it doesn't break self-rebuilds.
1 parent 1e4f9e3 commit 5f387bc

File tree

5 files changed

+5
-3
lines changed

5 files changed

+5
-3
lines changed

library/std/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cargo-features = ["public-dependency"]
2-
31
[package]
42
name = "std"
53
version = "0.0.0"

src/bootstrap/src/core/build_steps/clean.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ macro_rules! clean_crate_tree {
7272
// Since https://github.com/rust-lang/rust/pull/111076 enables
7373
// unstable cargo feature (`public-dependency`), we need to ensure
7474
// that unstable features are enabled before reading libstd Cargo.toml.
75-
cargo.env("RUSTC_BOOTSTRAP", "1");
75+
cargo.env("RUSTC_BOOTSTRAP", "1")
76+
.arg("-Zpublic-dependency");
7677

7778
for krate in &*self.crates {
7879
cargo.arg("-p");

src/bootstrap/src/core/build_steps/dist.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,7 @@ impl Step for PlainSourceTarball {
10141014
// Will read the libstd Cargo.toml
10151015
// which uses the unstable `public-dependency` feature.
10161016
.env("RUSTC_BOOTSTRAP", "1")
1017+
.arg("-Zpublic-dependency")
10171018
.current_dir(plain_dst_src);
10181019

10191020
let config = if !builder.config.dry_run() {

src/bootstrap/src/core/build_steps/test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2816,6 +2816,7 @@ impl Step for Distcheck {
28162816
// Will read the libstd Cargo.toml
28172817
// which uses the unstable `public-dependency` feature.
28182818
.env("RUSTC_BOOTSTRAP", "1")
2819+
.arg("-Zpublic-dependency")
28192820
.arg("generate-lockfile")
28202821
.arg("--manifest-path")
28212822
.arg(&toml)

src/bootstrap/src/core/metadata.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ fn workspace_members(build: &Build) -> impl Iterator<Item = Package> {
7777
// Will read the libstd Cargo.toml
7878
// which uses the unstable `public-dependency` feature.
7979
.env("RUSTC_BOOTSTRAP", "1")
80+
.arg("-Zpublic-dependency")
8081
.arg("metadata")
8182
.arg("--format-version")
8283
.arg("1")

0 commit comments

Comments
 (0)