diff options
Diffstat (limited to 'src/libsyntax/ext/deriving/cmp')
| -rw-r--r-- | src/libsyntax/ext/deriving/cmp/eq.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/cmp/ord.rs | 12 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/cmp/totaleq.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/cmp/totalord.rs | 6 |
4 files changed, 14 insertions, 14 deletions
diff --git a/src/libsyntax/ext/deriving/cmp/eq.rs b/src/libsyntax/ext/deriving/cmp/eq.rs index ce2b9ba7894..d147875d5e1 100644 --- a/src/libsyntax/ext/deriving/cmp/eq.rs +++ b/src/libsyntax/ext/deriving/cmp/eq.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use ast::{MetaItem, item, expr}; +use ast::{MetaItem, item, Expr}; use codemap::Span; use ext::base::ExtCtxt; use ext::build::AstBuilder; @@ -20,11 +20,11 @@ pub fn expand_deriving_eq(cx: @ExtCtxt, in_items: ~[@item]) -> ~[@item] { // structures are equal if all fields are equal, and non equal, if // any fields are not equal or if the enum variants are different - fn cs_eq(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @expr { + fn cs_eq(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @Expr { cs_and(|cx, span, _, _| cx.expr_bool(span, false), cx, span, substr) } - fn cs_ne(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @expr { + fn cs_ne(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @Expr { cs_or(|cx, span, _, _| cx.expr_bool(span, true), cx, span, substr) } diff --git a/src/libsyntax/ext/deriving/cmp/ord.rs b/src/libsyntax/ext/deriving/cmp/ord.rs index 3f7492bb6b6..33f45d45bdb 100644 --- a/src/libsyntax/ext/deriving/cmp/ord.rs +++ b/src/libsyntax/ext/deriving/cmp/ord.rs @@ -9,7 +9,7 @@ // except according to those terms. use ast; -use ast::{MetaItem, item, expr}; +use ast::{MetaItem, item, Expr}; use codemap::Span; use ext::base::ExtCtxt; use ext::build::AstBuilder; @@ -48,8 +48,8 @@ pub fn expand_deriving_ord(cx: @ExtCtxt, } /// Strict inequality. -fn cs_op(less: bool, equal: bool, cx: @ExtCtxt, span: Span, substr: &Substructure) -> @expr { - let op = if less {ast::lt} else {ast::gt}; +fn cs_op(less: bool, equal: bool, cx: @ExtCtxt, span: Span, substr: &Substructure) -> @Expr { + let op = if less {ast::BiLt} else {ast::BiGt}; cs_fold( false, // need foldr, |cx, span, subexpr, self_f, other_fs| { @@ -79,13 +79,13 @@ fn cs_op(less: bool, equal: bool, cx: @ExtCtxt, span: Span, substr: &Substructur cx.expr_deref(span, self_f), cx.expr_deref(span, other_f)); - let not_cmp = cx.expr_unary(span, ast::not, + let not_cmp = cx.expr_unary(span, ast::UnNot, cx.expr_binary(span, op, cx.expr_deref(span, other_f), cx.expr_deref(span, self_f))); - let and = cx.expr_binary(span, ast::and, not_cmp, subexpr); - cx.expr_binary(span, ast::or, cmp, and) + let and = cx.expr_binary(span, ast::BiAnd, not_cmp, subexpr); + cx.expr_binary(span, ast::BiOr, cmp, and) }, cx.expr_bool(span, equal), |cx, span, args, _| { diff --git a/src/libsyntax/ext/deriving/cmp/totaleq.rs b/src/libsyntax/ext/deriving/cmp/totaleq.rs index 97b7464b3b5..c6123451071 100644 --- a/src/libsyntax/ext/deriving/cmp/totaleq.rs +++ b/src/libsyntax/ext/deriving/cmp/totaleq.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use ast::{MetaItem, item, expr}; +use ast::{MetaItem, item, Expr}; use codemap::Span; use ext::base::ExtCtxt; use ext::build::AstBuilder; @@ -18,7 +18,7 @@ pub fn expand_deriving_totaleq(cx: @ExtCtxt, span: Span, mitem: @MetaItem, in_items: ~[@item]) -> ~[@item] { - fn cs_equals(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @expr { + fn cs_equals(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @Expr { cs_and(|cx, span, _, _| cx.expr_bool(span, false), cx, span, substr) } diff --git a/src/libsyntax/ext/deriving/cmp/totalord.rs b/src/libsyntax/ext/deriving/cmp/totalord.rs index 8f520ff6c33..34c6d1104da 100644 --- a/src/libsyntax/ext/deriving/cmp/totalord.rs +++ b/src/libsyntax/ext/deriving/cmp/totalord.rs @@ -9,7 +9,7 @@ // except according to those terms. use ast; -use ast::{MetaItem, item, expr}; +use ast::{MetaItem, item, Expr}; use codemap::Span; use ext::base::ExtCtxt; use ext::build::AstBuilder; @@ -54,7 +54,7 @@ pub fn ordering_const(cx: @ExtCtxt, span: Span, cnst: Ordering) -> ast::Path { } pub fn cs_cmp(cx: @ExtCtxt, span: Span, - substr: &Substructure) -> @expr { + substr: &Substructure) -> @Expr { let test_id = cx.ident_of("__test"); let equals_path = ordering_const(cx, span, Equal); @@ -89,7 +89,7 @@ pub fn cs_cmp(cx: @ExtCtxt, span: Span, let assign = cx.stmt_let(span, false, test_id, new); - let cond = cx.expr_binary(span, ast::eq, + let cond = cx.expr_binary(span, ast::BiEq, cx.expr_ident(span, test_id), cx.expr_path(equals_path.clone())); let if_ = cx.expr_if(span, |
