From ecaa96418bfff378a229ebf79d14f9e3c312cf78 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Fri, 1 Nov 2019 23:24:07 +0300 Subject: `Span` cannot represent `span.hi < span.lo` So we can remove the corresponding checks from various code --- src/libsyntax/parse/lexer/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index e6dc9a4c134..5ac60b017d3 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -68,7 +68,7 @@ impl<'a> StringReader<'a> { let end = sess.source_map().lookup_byte_offset(span.hi()); // Make the range zero-length if the span is invalid. - if span.lo() > span.hi() || begin.sf.start_pos != end.sf.start_pos { + if begin.sf.start_pos != end.sf.start_pos { span = span.shrink_to_lo(); } -- cgit 1.4.1-3-g733a5