about summary refs log tree commit diff
path: root/src/libsyntax/parse/lexer
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-03-18 01:50:52 +0000
committerbors <bors@rust-lang.org>2018-03-18 01:50:52 +0000
commit5e3ecdce4e42ccc34c49f32f81be71ae00f2cf11 (patch)
tree5e306a69e1f08b96188fb8f19f0bfc79dde37caf /src/libsyntax/parse/lexer
parentca6a98426192f838cc90a18709f92d425b86029e (diff)
parenta02b1d7e2bd329bee0ad2f6a3e281c2004325540 (diff)
downloadrust-5e3ecdce4e42ccc34c49f32f81be71ae00f2cf11.tar.gz
rust-5e3ecdce4e42ccc34c49f32f81be71ae00f2cf11.zip
Auto merge of #48917 - petrochenkov:import, r=oli-obk
syntax: Make imports in AST closer to the source and cleanup their parsing

This is a continuation of https://github.com/rust-lang/rust/pull/45846 in some sense.
Diffstat (limited to 'src/libsyntax/parse/lexer')
-rw-r--r--src/libsyntax/parse/lexer/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs
index 9d1bfba7b94..0e20eb49d39 100644
--- a/src/libsyntax/parse/lexer/mod.rs
+++ b/src/libsyntax/parse/lexer/mod.rs
@@ -214,7 +214,7 @@ impl<'a> StringReader<'a> {
 
         // Make the range zero-length if the span is invalid.
         if span.lo() > span.hi() || begin.fm.start_pos != end.fm.start_pos {
-            span = span.with_hi(span.lo());
+            span = span.shrink_to_lo();
         }
 
         let mut sr = StringReader::new_raw_internal(sess, begin.fm);