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

fix: remove unnecessary aggressive assertion #21

Merged
merged 1 commit into from
Jan 25, 2024
Merged
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
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