diff --git a/compiler/rustc_metadata/src/rmeta/decoder.rs b/compiler/rustc_metadata/src/rmeta/decoder.rs index 46d469f0703..ccba77d7aa7 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder.rs @@ -111,8 +111,9 @@ pub(crate) struct CrateMetadata { dep_kind: Lock, /// Filesystem location of this crate. source: Lrc, - /// Whether or not this crate should be consider a private dependency - /// for purposes of the 'exported_private_dependencies' lint + /// Whether or not this crate should be consider a private dependency. + /// Used by the 'exported_private_dependencies' lint, and for determining + /// whether to emit suggestions that reference this crate. private_dep: Lock, /// The hash for the host proc macro. Used to support `-Z dual-proc-macro`. host_hash: Option, diff --git a/src/bootstrap/metadata.rs b/src/bootstrap/metadata.rs index d8671ef2639..3b20ceac875 100644 --- a/src/bootstrap/metadata.rs +++ b/src/bootstrap/metadata.rs @@ -74,6 +74,8 @@ fn workspace_members(build: &Build) -> impl Iterator { let collect_metadata = |manifest_path| { let mut cargo = Command::new(&build.initial_cargo); cargo + // Will read the libstd Cargo.toml + // which uses the unstable `public-dependency` feature. .env("RUSTC_BOOTSTRAP", "1") .arg("metadata") .arg("--format-version") diff --git a/src/tools/rust-installer/combine-installers.sh b/src/tools/rust-installer/combine-installers.sh index c2de3385a80..01e5a00af4a 100755 --- a/src/tools/rust-installer/combine-installers.sh +++ b/src/tools/rust-installer/combine-installers.sh @@ -11,6 +11,8 @@ abs_path() { (unset CDPATH && cd "$path" > /dev/null && pwd) } +# Running cargo will read the libstd Cargo.toml +# which uses the unstable `public-dependency` feature. export RUSTC_BOOTSTRAP=1 src_dir="$(abs_path $(dirname "$0"))" diff --git a/src/tools/rust-installer/gen-installer.sh b/src/tools/rust-installer/gen-installer.sh index 10a69ff5ac5..cc45b5e0803 100755 --- a/src/tools/rust-installer/gen-installer.sh +++ b/src/tools/rust-installer/gen-installer.sh @@ -11,6 +11,8 @@ abs_path() { (unset CDPATH && cd "$path" > /dev/null && pwd) } +# Running cargo will read the libstd Cargo.toml +# which uses the unstable `public-dependency` feature. export RUSTC_BOOTSTRAP=1 src_dir="$(abs_path $(dirname "$0"))" diff --git a/src/tools/rust-installer/make-tarballs.sh b/src/tools/rust-installer/make-tarballs.sh index 4aadf078ff1..374e103e89c 100755 --- a/src/tools/rust-installer/make-tarballs.sh +++ b/src/tools/rust-installer/make-tarballs.sh @@ -11,6 +11,8 @@ abs_path() { (unset CDPATH && cd "$path" > /dev/null && pwd) } +# Running cargo will read the libstd Cargo.toml +# which uses the unstable `public-dependency` feature. export RUSTC_BOOTSTRAP=1 src_dir="$(abs_path $(dirname "$0"))" diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs index 2ad0ae527ac..a9eada22fc0 100644 --- a/src/tools/tidy/src/main.rs +++ b/src/tools/tidy/src/main.rs @@ -16,7 +16,9 @@ use std::sync::atomic::{AtomicBool, Ordering}; use std::thread::{self, scope, ScopedJoinHandle}; fn main() { - // Allow using unstable cargo features in the standard library. + // Running Cargo will read the libstd Cargo.toml + // which uses the unstable `public-dependency` feature. + // // `setenv` might not be thread safe, so run it before using multiple threads. env::set_var("RUSTC_BOOTSTRAP", "1");