fix ambiguity reporting (#9648)

# Objective

- I broke ambiguity reporting in one of my refactors.
`conflicts_to_string` should have been using the passed in parameter
rather than the one stored on self.
This commit is contained in:
Mike 2023-08-31 12:06:13 -07:00 committed by GitHub
parent 3527288342
commit c2b85f9b52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -1014,7 +1014,7 @@ mod tests {
let ambiguities: Vec<_> = schedule
.graph()
.conflicts_to_string(world.components())
.conflicts_to_string(schedule.graph().conflicting_systems(), world.components())
.collect();
let expected = &[

View file

@ -1553,7 +1553,7 @@ impl ScheduleGraph {
Consider adding `before`, `after`, or `ambiguous_with` relationships between these:\n",
);
for (name_a, name_b, conflicts) in self.conflicts_to_string(components) {
for (name_a, name_b, conflicts) in self.conflicts_to_string(ambiguities, components) {
writeln!(message, " -- {name_a} and {name_b}").unwrap();
if !conflicts.is_empty() {
@ -1571,9 +1571,10 @@ impl ScheduleGraph {
/// convert conflics to human readable format
pub fn conflicts_to_string<'a>(
&'a self,
ambiguities: &'a [(NodeId, NodeId, Vec<ComponentId>)],
components: &'a Components,
) -> impl Iterator<Item = (String, String, Vec<&str>)> + 'a {
self.conflicting_systems
ambiguities
.iter()
.map(move |(system_a, system_b, conflicts)| {
let name_a = self.get_node_name(system_a);