Skip to content

Commit

Permalink
Auto merge of rust-lang#14090 - Eh2406:clean_up_public_deps, r=weihanglo
Browse files Browse the repository at this point in the history
remove some legacy public dependency code from the resolver

These conflict reasons are no longer constructed, since we removed backtracking caused by public dependencies. Let's go ahead and remove them.

r? `@epage`
  • Loading branch information
bors committed Jun 17, 2024
2 parents 83a3964 + 94acc28 commit d899ce7
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 30 deletions.
5 changes: 0 additions & 5 deletions src/cargo/core/resolver/conflict_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,6 @@ impl ConflictCache {
/// `dep` is known to be unresolvable if
/// all the `PackageId` entries are activated.
pub fn insert(&mut self, dep: &Dependency, con: &ConflictMap) {
if con.values().any(|c| c.is_public_dependency()) {
// TODO: needs more info for back jumping
// for now refuse to cache it.
return;
}
self.con_from_dep
.entry(dep.clone())
.or_insert_with(|| ConflictStoreTrie::Node(BTreeMap::new()))
Expand Down
8 changes: 0 additions & 8 deletions src/cargo/core/resolver/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,6 @@ pub(super) fn activation_error(
);
// p == parent so the full path is redundant.
}
ConflictReason::PublicDependency(pkg_id) => {
// TODO: This needs to be implemented.
unimplemented!("pub dep {:?}", pkg_id);
}
ConflictReason::PubliclyExports(pkg_id) => {
// TODO: This needs to be implemented.
unimplemented!("pub exp {:?}", pkg_id);
}
}
}

Expand Down
4 changes: 0 additions & 4 deletions src/cargo/core/resolver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -820,10 +820,6 @@ fn generalize_conflicting(
let backtrack_critical_reason: ConflictReason =
conflicting_activations[&backtrack_critical_id].clone();

if backtrack_critical_reason.is_public_dependency() {
return None;
}

if cx
.parents
.is_path_from_to(&parent.package_id(), &backtrack_critical_id)
Expand Down
13 changes: 0 additions & 13 deletions src/cargo/core/resolver/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,6 @@ pub enum ConflictReason {
/// A dependency listed a feature for an optional dependency, but that
/// optional dependency is "hidden" using namespaced `dep:` syntax.
NonImplicitDependencyAsFeature(InternedString),

// TODO: needs more info for `activation_error`
// TODO: needs more info for `find_candidate`
/// pub dep error
PublicDependency(PackageId),
PubliclyExports(PackageId),
}

impl ConflictReason {
Expand All @@ -320,13 +314,6 @@ impl ConflictReason {
pub fn is_required_dependency_as_features(&self) -> bool {
matches!(self, ConflictReason::RequiredDependencyAsFeature(_))
}

pub fn is_public_dependency(&self) -> bool {
matches!(
self,
ConflictReason::PublicDependency(_) | ConflictReason::PubliclyExports(_)
)
}
}

/// A list of packages that have gotten in the way of resolving a dependency.
Expand Down

0 comments on commit d899ce7

Please sign in to comment.