Skip to content

Commit

Permalink
fix: remove unnecessary aggressive assertion (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
aochagavia authored Jan 25, 2024
1 parent 7c1fa14 commit 53a14d5
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/solver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,19 @@ impl<VS: VersionSet, N: PackageName + Display, D: DependencyProvider<VS, N>> Sol
// Exclusions are negative assertions, tracked outside of the watcher system
self.negative_assertions.push((solvable_id, clause_id));

// There should always be a conflict here
debug_assert!(
self.decision_tracker.assigned_value(solvable_id) == Some(true)
);

// The new assertion should be kept (it is returned in the lhs of the
// tuple), but it should also be marked as the source of a conflict (rhs
// There might be a conflict now
let conflicts = if self.decision_tracker.assigned_value(solvable_id)
== Some(true)
{
vec![clause_id]
} else {
Vec::new()
};

// The new assertion should be kept in all cases (it is returned in the
// lhs of the tuple), and a conflicts should be reported if present (rhs
// of the tuple)
return Ok((vec![clause_id], vec![clause_id]));
return Ok((vec![clause_id], conflicts));
}
}
}
Expand Down

0 comments on commit 53a14d5

Please sign in to comment.