about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-07-10 00:47:35 +0000
committerbors <bors@rust-lang.org>2015-07-10 00:47:35 +0000
commit736886c84b6ad372929b6531dbe05f5e7f88995b (patch)
tree0fa1a4e16b2b94996f0a5f7c7e241988da4f503a /src/libsyntax/parse
parent67256dff6dd7526f0be9da5092a6b3e390654c8c (diff)
parent0c766cb8bc62fcd016165db2313188e7f6de71dd (diff)
downloadrust-736886c84b6ad372929b6531dbe05f5e7f88995b.tar.gz
rust-736886c84b6ad372929b6531dbe05f5e7f88995b.zip
Auto merge of #26907 - nrc:save-fns, r=brson
r? @huonw 
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 03c788aee58..81ae607fea2 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -1566,12 +1566,13 @@ impl<'a> Parser<'a> {
     // Assumes that the leading `<` has been parsed already.
     pub fn parse_qualified_path(&mut self, mode: PathParsingMode)
                                 -> PResult<(QSelf, ast::Path)> {
+        let span = self.last_span;
         let self_type = try!(self.parse_ty_sum());
         let mut path = if try!(self.eat_keyword(keywords::As)) {
             try!(self.parse_path(LifetimeAndTypesWithoutColons))
         } else {
             ast::Path {
-                span: self.span,
+                span: span,
                 global: false,
                 segments: vec![]
             }
@@ -1598,9 +1599,6 @@ impl<'a> Parser<'a> {
         };
         path.segments.extend(segments);
 
-        if path.segments.len() == 1 {
-            path.span.lo = self.last_span.lo;
-        }
         path.span.hi = self.last_span.hi;
 
         Ok((qself, path))