diff --git a/compiler/rustc_metadata/src/dependency_format.rs b/compiler/rustc_metadata/src/dependency_format.rs index f29ab56bb66ad..1dbe6e8c41fb1 100644 --- a/compiler/rustc_metadata/src/dependency_format.rs +++ b/compiler/rustc_metadata/src/dependency_format.rs @@ -164,7 +164,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList { let mut upstream_in_dylibs = FxHashSet::default(); - if sess.opts.unstable_opts.prefer_deps_of_dynamic { + if sess.opts.unstable_opts.prefer_deps_of_dynamic || tcx.features().rustc_private { // Find all libraries statically linked to upstream dylibs. for &cnum in all_dylibs() { let deps = tcx.dylib_dependency_formats(cnum);