diff options
| author | Kevin Butler <haqkrs@gmail.com> | 2014-06-13 22:56:42 +0100 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-06-16 18:15:54 -0700 |
| commit | 9945052e64737a21a7d9a6cb337bda1a4eed3e0a (patch) | |
| tree | 5964aa5da4cac6a05608d32ca85100b4200e7b0a /src/libsyntax/parse | |
| parent | 051abae802318d8401c9b5e6baa9ffc863f7f8eb (diff) | |
| download | rust-9945052e64737a21a7d9a6cb337bda1a4eed3e0a.tar.gz rust-9945052e64737a21a7d9a6cb337bda1a4eed3e0a.zip | |
rustc: Improve span for error about using a method as a field.
libsyntax: ExprField now contains a SpannedIdent rather than Ident. [breaking-change]
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 8b50a6270bc..bbe0680ef14 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1796,7 +1796,7 @@ impl<'a> Parser<'a> { ExprIndex(expr, idx) } - pub fn mk_field(&mut self, expr: Gc<Expr>, ident: Ident, + pub fn mk_field(&mut self, expr: Gc<Expr>, ident: ast::SpannedIdent, tys: Vec<P<Ty>>) -> ast::Expr_ { ExprField(expr, ident, tys) } @@ -2090,7 +2090,8 @@ impl<'a> Parser<'a> { e = self.mk_expr(lo, hi, nd); } _ => { - let field = self.mk_field(e, i, tys); + let id = spanned(dot, hi, i); + let field = self.mk_field(e, id, tys); e = self.mk_expr(lo, hi, field) } } |
