Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove some legacy public dependency code from the resolver #14090

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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