Skip to content

Commit dfe4666

Browse files
committed
Ensure that SpanData::cmp returns Equal whenever PartialEq does
1 parent b190ab2 commit dfe4666

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_span/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,9 @@ pub struct SpanData {
480480
// Order spans by position in the file.
481481
impl Ord for SpanData {
482482
fn cmp(&self, other: &Self) -> Ordering {
483+
if self == other {
484+
return Ordering::Equal;
485+
}
483486
let SpanData {
484487
lo: s_lo,
485488
hi: s_hi,

0 commit comments

Comments
 (0)