Skip to content

Commit 71dfe64

Browse files
committed
Normalize order of lo and hi in Span::new
1 parent 3da868d commit 71dfe64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libsyntax_pos/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub struct MultiSpan {
8484
impl Span {
8585
#[inline]
8686
pub fn new(lo: BytePos, hi: BytePos, ctxt: SyntaxContext) -> Self {
87-
Span { lo, hi, ctxt }
87+
if lo <= hi { Span { lo, hi, ctxt } } else { Span { lo: hi, hi: lo, ctxt } }
8888
}
8989

9090
#[inline]

0 commit comments

Comments
 (0)