Skip to content

Commit

Permalink
Make incompatibilities pub again
Browse files Browse the repository at this point in the history
I must have dropped this when rebasing
  • Loading branch information
konstin committed May 21, 2024
1 parent 8e4842a commit e7f9551
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/unsat_root_message_no_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl ReportFormatter<Package, Range<SemanticVersion>, String> for CustomReportFo
External::NotRoot(package, version) => {
format!("we are solving dependencies of {package} {version}")
}
External::NoVersions(package, set, _) => {
External::NoVersions(package, set) => {
if set == &Range::full() {
format!("there is no available version for {package}")
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/internal/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub struct State<DP: DependencyProvider> {

/// The set of incompatibilities for each package.
#[allow(clippy::type_complexity)]
incompatibilities: Map<DP::P, Vec<IncompDpId<DP>>>,
pub incompatibilities: Map<DP::P, Vec<IncompDpId<DP>>>,

/// Store the ids of incompatibilities that are already contradicted.
/// For each one keep track of the decision level when it was found to be contradicted.
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
//! &self,
//! package: &String,
//! version: &SemanticVersion,
//! ) -> Result<Dependencies<impl IntoIterator<Item = (String, SemVS)> + Clone, Self::M>, Infallible> {
//! ) -> Result<Dependencies<impl IntoIterator<Item = (Self::P, Self::VS)> + Clone, Self::M>, Infallible> {
//! Ok(Dependencies::Available([]))
//! }
//!
Expand Down
10 changes: 5 additions & 5 deletions src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub enum External<P: Package, VS: VersionSet, M: Eq + Clone + Debug + Display> {
/// Initial incompatibility aiming at picking the root package for the first decision.
NotRoot(P, VS::V),
/// There are no versions in the given set for this package. A string reason is included.
NoVersions(P, VS, Option<String>),
NoVersions(P, VS),
/// Incompatibility coming from the dependencies of a given package.
FromDependencyOf(P, VS, P, VS),
/// The package is unusable for reasons outside pubgrub.
Expand Down Expand Up @@ -82,7 +82,7 @@ impl<P: Package, VS: VersionSet, M: Eq + Clone + Debug + Display> DerivationTree
packages.insert(p);
packages.insert(p2);
}
External::NoVersions(p, _, _)
External::NoVersions(p, _)
| External::NotRoot(p, _)
| External::Custom(p, _, _) => {
packages.insert(p);
Expand Down Expand Up @@ -115,14 +115,14 @@ impl<P: Package, VS: VersionSet, M: Eq + Clone + Debug + Display> DerivationTree
Arc::make_mut(&mut derived.cause1),
Arc::make_mut(&mut derived.cause2),
) {
(DerivationTree::External(External::NoVersions(p, r, _)), ref mut cause2) => {
(DerivationTree::External(External::NoVersions(p, r)), ref mut cause2) => {
cause2.collapse_no_versions();
*self = cause2
.clone()
.merge_no_versions(p.to_owned(), r.to_owned())
.unwrap_or_else(|| self.to_owned());
}
(ref mut cause1, DerivationTree::External(External::NoVersions(p, r, _))) => {
(ref mut cause1, DerivationTree::External(External::NoVersions(p, r))) => {
cause1.collapse_no_versions();
*self = cause1
.clone()
Expand Down Expand Up @@ -180,7 +180,7 @@ impl<P: Package, VS: VersionSet, M: Eq + Clone + Debug + Display> fmt::Display
Self::NotRoot(package, version) => {
write!(f, "we are solving dependencies of {} {}", package, version)
}
Self::NoVersions(package, set, _) => {
Self::NoVersions(package, set) => {
if set == &VS::full() {
write!(f, "there is no available version for {}", package)
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/proptest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl<DP: DependencyProvider> DependencyProvider for TimeoutDependencyProvider<DP
&self,
p: &DP::P,
v: &DP::V,
) -> Result<Dependencies<impl IntoIterator<Item = (DP::P, DP::VS)> + Clone, Self::M>, DP::Err>
) -> Result<Dependencies<impl IntoIterator<Item = (DP::P, DP::VS)> + Clone, DP::M>, DP::Err>
{
self.dp.get_dependencies(p, v)
}
Expand Down

0 comments on commit e7f9551

Please sign in to comment.