diff options
| author | Trevor Gross <tmgross@umich.edu> | 2025-01-14 20:04:59 +0000 |
|---|---|---|
| committer | Trevor Gross <tmgross@umich.edu> | 2025-02-21 17:37:03 +0000 |
| commit | cb1d076d42e9285488436688b8879225ab6db80e (patch) | |
| tree | f952a5bbe4d7fa3afd3fee60ebc1f04e1f12e8c9 /compiler/rustc_metadata | |
| parent | 1412cfc987b2b6691367c2e7428c083bb207d722 (diff) | |
| download | rust-cb1d076d42e9285488436688b8879225ab6db80e.tar.gz rust-cb1d076d42e9285488436688b8879225ab6db80e.zip | |
Partially revert ed63539282 ("Mark dependencies ... private by default")
Remove the portion of ed63539282 that automatically sets crates private based on whether they are dependencies of `std`. Instead, this is controlled by dependency configuration in `Cargo.toml`.
Diffstat (limited to 'compiler/rustc_metadata')
| -rw-r--r-- | compiler/rustc_metadata/src/creader.rs | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/compiler/rustc_metadata/src/creader.rs b/compiler/rustc_metadata/src/creader.rs index a935bc3662d..b94e32e17d4 100644 --- a/compiler/rustc_metadata/src/creader.rs +++ b/compiler/rustc_metadata/src/creader.rs @@ -32,7 +32,7 @@ use rustc_session::lint::{self, BuiltinLintDiag}; use rustc_session::output::validate_crate_name; use rustc_session::search_paths::PathKind; use rustc_span::edition::Edition; -use rustc_span::{DUMMY_SP, Ident, STDLIB_STABLE_CRATES, Span, Symbol, sym}; +use rustc_span::{DUMMY_SP, Ident, Span, Symbol, sym}; use rustc_target::spec::{PanicStrategy, Target, TargetTuple}; use tracing::{debug, info, trace}; @@ -533,27 +533,11 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> { private_dep: Option<bool>, origin: CrateOrigin<'_>, ) -> bool { - // Standard library crates are never private. - if STDLIB_STABLE_CRATES.contains(&name) { - tracing::info!("returning false for {name} is private"); - return false; - } - if matches!(origin, CrateOrigin::Injected) { return true; } let extern_private = self.sess.opts.externs.get(name.as_str()).map(|e| e.is_private_dep); - - // Any descendants of `std` should be private. These crates are usually not marked - // private in metadata, so we ignore that field. - if extern_private.is_none() - && let Some(dep) = origin.dep_root() - && STDLIB_STABLE_CRATES.contains(&dep.name) - { - return true; - } - match (extern_private, private_dep) { // Explicit non-private via `--extern`, explicit non-private from metadata, or // unspecified with default to public. |
