diff options
| author | bors <bors@rust-lang.org> | 2015-01-24 17:07:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-01-24 17:07:43 +0000 |
| commit | 76fbb3583174ca8856b4e149929839888f503e6b (patch) | |
| tree | 1e1cdcedcfcb4c652e6fb9d7e295c03008a0ba75 /src/libsyntax/ext | |
| parent | 0430a43d635841db44978bb648e9cf7e7cfa1bba (diff) | |
| parent | ec790d6fcc426e13431cbb7510c62864515a3ef8 (diff) | |
| download | rust-76fbb3583174ca8856b4e149929839888f503e6b.tar.gz rust-76fbb3583174ca8856b4e149929839888f503e6b.zip | |
Auto merge of #21079 - huonw:chained-cmp-tweaks, r=pnkfelix
First commit is mindless groundwork for the second one, to make the spans (arguably) nicer.
### before
```
require-parens-for-chained-comparison.rs:14:20: 14:22 error: Chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:14 false == false == false;
^~
require-parens-for-chained-comparison.rs:17:16: 17:17 error: Chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:17 false == 0 < 2;
^
require-parens-for-chained-comparison.rs:20:8: 20:9 error: Chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:20 f<X>();
^
require-parens-for-chained-comparison.rs:20:8: 20:9 help: Use ::< instead of < if you meant to specify type arguments.
require-parens-for-chained-comparison.rs:20 f<X>();
^
```
### after
```
require-parens-for-chained-comparison.rs:14:11: 14:22 error: chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:14 false == false == false;
^~~~~~~~~~~
require-parens-for-chained-comparison.rs:17:11: 17:17 error: chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:17 false == 0 < 2;
^~~~~~
require-parens-for-chained-comparison.rs:20:6: 20:9 error: chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:20 f<X>();
^~~
require-parens-for-chained-comparison.rs:20:6: 20:9 help: use `::<...>` instead of `<...>` if you meant to specify type arguments
require-parens-for-chained-comparison.rs:20 f<X>();
^~~
```
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/build.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/generic/mod.rs | 2 |
2 files changed, 4 insertions, 4 deletions
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<ast::Expr>; fn expr_self(&self, span: Span) -> P<ast::Expr>; - fn expr_binary(&self, sp: Span, op: ast::BinOp, + fn expr_binary(&self, sp: Span, op: ast::BinOp_, lhs: P<ast::Expr>, rhs: P<ast::Expr>) -> P<ast::Expr>; fn expr_deref(&self, sp: Span, e: P<ast::Expr>) -> P<ast::Expr>; fn expr_unary(&self, sp: Span, op: ast::UnOp, e: P<ast::Expr>) -> P<ast::Expr>; @@ -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<ast::Expr>, rhs: P<ast::Expr>) -> P<ast::Expr> { - 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<ast::Expr>) -> P<ast::Expr> { 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<F>(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<Expr>, +pub fn cs_binop(binop: ast::BinOp_, base: P<Expr>, enum_nonmatch_f: EnumNonMatchCollapsedFunc, cx: &mut ExtCtxt, trait_span: Span, substructure: &Substructure) -> P<Expr> { |
