about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-10-29 07:41:48 -0700
committerbors <bors@rust-lang.org>2013-10-29 07:41:48 -0700
commite6650c87a3800264a043b7f129e6a4841c4cc3f7 (patch)
tree24ae6ffd80bed67e40373a1b0163c5b401e59c20 /src/libsyntax/parse
parentfc766efd16231e521365a29a73bca7f2c4178e9c (diff)
parenta71665798bdd629ff8d328ef325723b79a2542a7 (diff)
downloadrust-e6650c87a3800264a043b7f129e6a4841c4cc3f7.tar.gz
rust-e6650c87a3800264a043b7f129e6a4841c4cc3f7.zip
auto merge of #10142 : pythonesque/rust/issue-8263, r=catamorphism
This is, I think, the minimal change required.  I would have included a test but as far as I can tell there is currently no way to precisely test that the span for an error underlines the correct word.  I did verify it manually.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 5a5e310e56f..8b399266676 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -1549,10 +1549,11 @@ impl Parser {
     pub fn parse_field(&self) -> Field {
         let lo = self.span.lo;
         let i = self.parse_ident();
+        let hi = self.last_span.hi;
         self.expect(&token::COLON);
         let e = self.parse_expr();
         ast::Field {
-            ident: i,
+            ident: spanned(lo, hi, i),
             expr: e,
             span: mk_sp(lo, e.span.hi),
         }