Skip to content

Commit 076ecff

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 0ad5e0d commit 076ecff

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
@@ -71,7 +71,8 @@ macro_rules! clean_crate_tree {
7171
// Since https://github.com/rust-lang/rust/pull/111076 enables
7272
// unstable cargo feature (`public-dependency`), we need to ensure
7373
// that unstable features are enabled before reading libstd Cargo.toml.
74-
cargo.env("RUSTC_BOOTSTRAP", "1");
74+
cargo.env("RUSTC_BOOTSTRAP", "1")
75+
.arg("-Zpublic-dependency");
7576

7677
for krate in &*self.crates {
7778
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
@@ -2899,6 +2899,7 @@ impl Step for Distcheck {
28992899
// Will read the libstd Cargo.toml
29002900
// which uses the unstable `public-dependency` feature.
29012901
.env("RUSTC_BOOTSTRAP", "1")
2902+
.arg("-Zpublic-dependency")
29022903
.arg("generate-lockfile")
29032904
.arg("--manifest-path")
29042905
.arg(&toml)

src/bootstrap/src/core/metadata.rs

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

0 commit comments

Comments
 (0)