diff options
| author | Edward Wang <edward.yu.wang@gmail.com> | 2014-04-24 05:19:23 +0800 |
|---|---|---|
| committer | Edward Wang <edward.yu.wang@gmail.com> | 2014-04-24 06:16:46 +0800 |
| commit | 899f22238669bade874f29f784cdffba28ff0982 (patch) | |
| tree | dec876a0dd6a32f30d555388c592cf8a579b0390 /src/libsyntax/ext | |
| parent | b5dd3f05fe95168b5569d0f519636149479eb6ac (diff) | |
| download | rust-899f22238669bade874f29f784cdffba28ff0982.tar.gz rust-899f22238669bade874f29f784cdffba28ff0982.zip | |
Calibrate span for method call error messages
Specifically, the method parameter cardinality mismatch or missing method error message span now gets method itself exactly. It was the whole expression. Closes #9390 Closes #13684 Closes #13709
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/build.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index e1174ea6cc4..d5465303394 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -12,7 +12,7 @@ use abi; use ast::{P, Ident}; use ast; use ast_util; -use codemap::{Span, respan, DUMMY_SP}; +use codemap::{Span, respan, Spanned, DUMMY_SP}; use ext::base::ExtCtxt; use ext::quote::rt::*; use fold::Folder; @@ -548,8 +548,9 @@ impl<'a> AstBuilder for ExtCtxt<'a> { expr: @ast::Expr, ident: ast::Ident, mut args: Vec<@ast::Expr> ) -> @ast::Expr { + let id = Spanned { node: ident, span: span }; args.unshift(expr); - self.expr(span, ast::ExprMethodCall(ident, Vec::new(), args)) + self.expr(span, ast::ExprMethodCall(id, Vec::new(), args)) } fn expr_block(&self, b: P<ast::Block>) -> @ast::Expr { self.expr(b.span, ast::ExprBlock(b)) |
