Skip to content

Commit da92cd6

Browse files
committed
Use special Debug format when start > end
1 parent f5d8749 commit da92cd6

File tree

1 file changed

+5
-1
lines changed
  • compiler/rustc_target/src/abi

1 file changed

+5
-1
lines changed

compiler/rustc_target/src/abi/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,11 @@ impl WrappingRange {
784784

785785
impl fmt::Debug for WrappingRange {
786786
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
787-
write!(fmt, "{}..={}", self.start, self.end)?;
787+
if self.start > self.end {
788+
write!(fmt, "(..={}) | ({}..)", self.end, self.start)?;
789+
} else {
790+
write!(fmt, "{}..={}", self.start, self.end)?;
791+
}
788792
Ok(())
789793
}
790794
}

0 commit comments

Comments
 (0)