diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2015-07-08 17:47:27 +1200 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2015-07-09 12:24:39 +1200 |
| commit | f28f79b79615fc77e65ec42c4e2a3960659150c9 (patch) | |
| tree | 1d41a9c1b8b3fcd6d73e8d63448e0bc8ff1aab0b /src/libsyntax | |
| parent | 374af4aea7878127ca52cbc271fb1237b4afe223 (diff) | |
| download | rust-f28f79b79615fc77e65ec42c4e2a3960659150c9.tar.gz rust-f28f79b79615fc77e65ec42c4e2a3960659150c9.zip | |
Fix a span bug for qualified paths
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 6 |
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)) |
