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
This commit is contained in:
commit
70647ccc6d
9 changed files with 53 additions and 17 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue