Skip to content

Commit

Permalink
make issue ordering stable
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Nov 13, 2024
1 parent 86bb739 commit 2c297fa
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion turbopack/crates/turbopack-core/src/issue/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@ impl Ord for PlainIssue {
cmp!(self.description, other.description);
cmp!(self.detail, other.detail);
cmp!(self.documentation_link, other.documentation_link);
cmp!(self.source, other.source);
Ordering::Equal
}
}
Expand Down Expand Up @@ -791,7 +792,7 @@ impl PlainIssue {
}

#[turbo_tasks::value(serialization = "none")]
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialOrd, Ord)]
pub struct PlainIssueSource {
pub asset: ReadRef<PlainSource>,
pub range: Option<(SourcePos, SourcePos)>,
Expand Down Expand Up @@ -851,6 +852,18 @@ impl PlainSource {
}
}

impl Ord for PlainSource {
fn cmp(&self, other: &Self) -> Ordering {
self.ident.cmp(&other.ident)
}
}

impl PartialOrd for PlainSource {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}

#[turbo_tasks::value(transparent, serialization = "none")]
#[derive(Clone, Debug, DeterministicHash)]
pub struct PlainIssueProcessingPath(Option<Vec<ReadRef<PlainIssueProcessingPathItem>>>);
Expand Down

0 comments on commit 2c297fa

Please sign in to comment.