From f3b5ec2318914ae5a74d06e47b6f567f7dfc3623 Mon Sep 17 00:00:00 2001 From: Seo Sanghyeon Date: Tue, 11 Feb 2014 22:49:50 +0900 Subject: [PATCH] Correct span for self and ExprStruct --- src/libsyntax/parse/parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 507debc8ce0b5..4bef7dc5bb5ed 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1799,7 +1799,7 @@ impl Parser { } else if self.eat_keyword(keywords::Self) { let path = ast_util::ident_to_path(mk_sp(lo, hi), special_idents::self_); ex = ExprPath(path); - hi = self.span.hi; + hi = self.last_span.hi; } else if self.eat_keyword(keywords::If) { return self.parse_if_expr(); } else if self.eat_keyword(keywords::For) { @@ -1934,7 +1934,7 @@ impl Parser { &[token::COMMA], &[token::RBRACE]); } - hi = pth.span.hi; + hi = self.span.hi; self.expect(&token::RBRACE); ex = ExprStruct(pth, fields, base); return self.mk_expr(lo, hi, ex);