diff options
| author | bors <bors@rust-lang.org> | 2014-04-24 07:06:26 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-04-24 07:06:26 -0700 |
| commit | 70647ccc6de1c319de647a2b8d75b667e88fbfd0 (patch) | |
| tree | 716d2ba3a2b8791d5a782bee9726aacad92cd135 /src/libsyntax/ext | |
| parent | f5a5d7c32ca863533e53175da8afab6ba8d20f30 (diff) | |
| parent | 899f22238669bade874f29f784cdffba28ff0982 (diff) | |
| download | rust-70647ccc6de1c319de647a2b8d75b667e88fbfd0.tar.gz rust-70647ccc6de1c319de647a2b8d75b667e88fbfd0.zip | |
auto merge of #13713 : edwardw/rust/methodcall-span, r=alexcrichton
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 b0dbd8b635a..1a160cb33aa 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)) |
