From 2e888d0341e81de1744b257c25b012c2c148f0ba Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Tue, 13 Jan 2015 14:24:37 +1100 Subject: Add the span of the operator itself to ast::BinOp. --- src/libsyntax/ext/build.rs | 6 +++--- src/libsyntax/ext/deriving/generic/mod.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libsyntax/ext') diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index 92619cf42e4..2b3a7212683 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -106,7 +106,7 @@ pub trait AstBuilder { fn expr_ident(&self, span: Span, id: ast::Ident) -> P; fn expr_self(&self, span: Span) -> P; - fn expr_binary(&self, sp: Span, op: ast::BinOp, + fn expr_binary(&self, sp: Span, op: ast::BinOp_, lhs: P, rhs: P) -> P; fn expr_deref(&self, sp: Span, e: P) -> P; fn expr_unary(&self, sp: Span, op: ast::UnOp, e: P) -> P; @@ -561,9 +561,9 @@ impl<'a> AstBuilder for ExtCtxt<'a> { self.expr_ident(span, special_idents::self_) } - fn expr_binary(&self, sp: Span, op: ast::BinOp, + fn expr_binary(&self, sp: Span, op: ast::BinOp_, lhs: P, rhs: P) -> P { - self.expr(sp, ast::ExprBinary(op, lhs, rhs)) + self.expr(sp, ast::ExprBinary(Spanned { node: op, span: sp }, lhs, rhs)) } fn expr_deref(&self, sp: Span, e: P) -> P { diff --git a/src/libsyntax/ext/deriving/generic/mod.rs b/src/libsyntax/ext/deriving/generic/mod.rs index 272b0464010..f8812f4d28d 100644 --- a/src/libsyntax/ext/deriving/generic/mod.rs +++ b/src/libsyntax/ext/deriving/generic/mod.rs @@ -1449,7 +1449,7 @@ pub fn cs_same_method_fold(use_foldl: bool, /// Use a given binop to combine the result of calling the derived method /// on all the fields. #[inline] -pub fn cs_binop(binop: ast::BinOp, base: P, +pub fn cs_binop(binop: ast::BinOp_, base: P, enum_nonmatch_f: EnumNonMatchCollapsedFunc, cx: &mut ExtCtxt, trait_span: Span, substructure: &Substructure) -> P { -- cgit 1.4.1-3-g733a5