Skip to content

Commit d899ce7

Browse files
committed
Auto merge of #14090 - Eh2406:clean_up_public_deps, r=weihanglo
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`
2 parents 83a3964 + 94acc28 commit d899ce7

File tree

4 files changed

+0
-30
lines changed

4 files changed

+0
-30
lines changed

src/cargo/core/resolver/conflict_cache.rs

-5
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,6 @@ impl ConflictCache {
194194
/// `dep` is known to be unresolvable if
195195
/// all the `PackageId` entries are activated.
196196
pub fn insert(&mut self, dep: &Dependency, con: &ConflictMap) {
197-
if con.values().any(|c| c.is_public_dependency()) {
198-
// TODO: needs more info for back jumping
199-
// for now refuse to cache it.
200-
return;
201-
}
202197
self.con_from_dep
203198
.entry(dep.clone())
204199
.or_insert_with(|| ConflictStoreTrie::Node(BTreeMap::new()))

src/cargo/core/resolver/errors.rs

-8
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,6 @@ pub(super) fn activation_error(
193193
);
194194
// p == parent so the full path is redundant.
195195
}
196-
ConflictReason::PublicDependency(pkg_id) => {
197-
// TODO: This needs to be implemented.
198-
unimplemented!("pub dep {:?}", pkg_id);
199-
}
200-
ConflictReason::PubliclyExports(pkg_id) => {
201-
// TODO: This needs to be implemented.
202-
unimplemented!("pub exp {:?}", pkg_id);
203-
}
204196
}
205197
}
206198

src/cargo/core/resolver/mod.rs

-4
Original file line numberDiff line numberDiff line change
@@ -820,10 +820,6 @@ fn generalize_conflicting(
820820
let backtrack_critical_reason: ConflictReason =
821821
conflicting_activations[&backtrack_critical_id].clone();
822822

823-
if backtrack_critical_reason.is_public_dependency() {
824-
return None;
825-
}
826-
827823
if cx
828824
.parents
829825
.is_path_from_to(&parent.package_id(), &backtrack_critical_id)

src/cargo/core/resolver/types.rs

-13
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,6 @@ pub enum ConflictReason {
300300
/// A dependency listed a feature for an optional dependency, but that
301301
/// optional dependency is "hidden" using namespaced `dep:` syntax.
302302
NonImplicitDependencyAsFeature(InternedString),
303-
304-
// TODO: needs more info for `activation_error`
305-
// TODO: needs more info for `find_candidate`
306-
/// pub dep error
307-
PublicDependency(PackageId),
308-
PubliclyExports(PackageId),
309303
}
310304

311305
impl ConflictReason {
@@ -320,13 +314,6 @@ impl ConflictReason {
320314
pub fn is_required_dependency_as_features(&self) -> bool {
321315
matches!(self, ConflictReason::RequiredDependencyAsFeature(_))
322316
}
323-
324-
pub fn is_public_dependency(&self) -> bool {
325-
matches!(
326-
self,
327-
ConflictReason::PublicDependency(_) | ConflictReason::PubliclyExports(_)
328-
)
329-
}
330317
}
331318

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

0 commit comments

Comments
 (0)