Implement opt-in (and opt-out) rustc_private

This commit is contained in:
Daniel McNab 2021-03-06 12:17:22 +00:00
parent cd60c4f76c
commit 1076d21fc0
2 changed files with 26 additions and 3 deletions

View file

@ -499,7 +499,11 @@ fn cargo_to_crate_graph(
if let Some(&to) = pkg_to_lib_crate.get(&dep) {
for pkg in cargo.packages() {
if !cargo[pkg].is_member {
let package = &cargo[pkg];
if matches!(
(package.is_member, package.metadata.rustc_private),
(true, Some(false)) | (false, Some(false)) | (false, None)
) {
continue;
}
for &from in pkg_crates.get(&pkg).into_iter().flatten() {