about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-07-05 14:41:44 +0000
committerbors <bors@rust-lang.org>2014-07-05 14:41:44 +0000
commit98eb5f7498902de6ff19a1bb70155ca0cd16907c (patch)
treeddfab744be729eb78a9fe6631a8291f5a617dae9 /src/libsyntax/parse/parser.rs
parentc8bbba9a4be37128dc000c8a4c00ffe180219bb6 (diff)
parent9deeaefdbb8ffeec69439e271a97f4cce617da20 (diff)
downloadrust-98eb5f7498902de6ff19a1bb70155ca0cd16907c.tar.gz
rust-98eb5f7498902de6ff19a1bb70155ca0cd16907c.zip
auto merge of #15428 : phildawes/rust/master, r=huonw
Fix small bug introduced in e38cb972dcf: PatIdent span was incorrect
because self.last_span was being used before the ident token was
parsed.
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 960971b94d2..6b6387b0127 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -3118,8 +3118,9 @@ impl<'a> Parser<'a> {
             self.span_fatal(last_span,
                             "expected identifier, found path");
         }
-        // why a path here, and not just an identifier?
-        let name = codemap::Spanned{span: self.last_span, node: self.parse_ident()};
+        let ident = self.parse_ident();
+        let last_span = self.last_span;
+        let name = codemap::Spanned{span: last_span, node: ident};
         let sub = if self.eat(&token::AT) {
             Some(self.parse_pat())
         } else {