about summary refs log tree commit diff
path: root/src/libsyntax_ext
diff options
context:
space:
mode:
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2016-02-08 13:16:12 +0100
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2016-02-11 12:34:48 +0100
commit05e25de4f0add7ae3cd0e8f66cd4558c5bfa42aa (patch)
tree587130bb0d9d974e579d5a92a4893412351069fe /src/libsyntax_ext
parentf875f4c4c24e8a14c04bbe4eedd230c4aa3c1431 (diff)
downloadrust-05e25de4f0add7ae3cd0e8f66cd4558c5bfa42aa.tar.gz
rust-05e25de4f0add7ae3cd0e8f66cd4558c5bfa42aa.zip
[breaking-change] don't glob export ast::BinOp_
Diffstat (limited to 'src/libsyntax_ext')
-rw-r--r--src/libsyntax_ext/deriving/cmp/ord.rs5
-rw-r--r--src/libsyntax_ext/deriving/cmp/partial_eq.rs10
-rw-r--r--src/libsyntax_ext/deriving/cmp/partial_ord.rs11
-rw-r--r--src/libsyntax_ext/deriving/generic/mod.rs8
4 files changed, 16 insertions, 18 deletions
diff --git a/src/libsyntax_ext/deriving/cmp/ord.rs b/src/libsyntax_ext/deriving/cmp/ord.rs
index 95a5d184d0e..2fa847ee430 100644
--- a/src/libsyntax_ext/deriving/cmp/ord.rs
+++ b/src/libsyntax_ext/deriving/cmp/ord.rs
@@ -11,8 +11,7 @@
 use deriving::generic::*;
 use deriving::generic::ty::*;
 
-use syntax::ast;
-use syntax::ast::{MetaItem, Expr};
+use syntax::ast::{MetaItem, Expr, BinOpKind, self};
 use syntax::codemap::Span;
 use syntax::ext::base::{ExtCtxt, Annotatable};
 use syntax::ext::build::AstBuilder;
@@ -116,7 +115,7 @@ pub fn cs_cmp(cx: &mut ExtCtxt, span: Span,
 
             let assign = cx.stmt_let(span, false, test_id, new);
 
-            let cond = cx.expr_binary(span, ast::BiEq,
+            let cond = cx.expr_binary(span, BinOpKind::Eq,
                                       cx.expr_ident(span, test_id),
                                       cx.expr_path(equals_path.clone()));
             let if_ = cx.expr_if(span,
diff --git a/src/libsyntax_ext/deriving/cmp/partial_eq.rs b/src/libsyntax_ext/deriving/cmp/partial_eq.rs
index 29be5a7ddc3..0150a073b07 100644
--- a/src/libsyntax_ext/deriving/cmp/partial_eq.rs
+++ b/src/libsyntax_ext/deriving/cmp/partial_eq.rs
@@ -11,7 +11,7 @@
 use deriving::generic::*;
 use deriving::generic::ty::*;
 
-use syntax::ast::{MetaItem, Expr, self};
+use syntax::ast::{MetaItem, Expr, BinOpKind};
 use syntax::codemap::Span;
 use syntax::ext::base::{ExtCtxt, Annotatable};
 use syntax::ext::build::AstBuilder;
@@ -35,9 +35,9 @@ pub fn expand_deriving_partial_eq(cx: &mut ExtCtxt,
                     _ => cx.span_bug(span, "not exactly 2 arguments in `derive(PartialEq)`")
                 };
 
-                let eq = cx.expr_binary(span, ast::BiEq, self_f, other_f.clone());
+                let eq = cx.expr_binary(span, BinOpKind::Eq, self_f, other_f.clone());
 
-                cx.expr_binary(span, ast::BiAnd, subexpr, eq)
+                cx.expr_binary(span, BinOpKind::And, subexpr, eq)
             },
             cx.expr_bool(span, true),
             Box::new(|cx, span, _, _| cx.expr_bool(span, false)),
@@ -52,9 +52,9 @@ pub fn expand_deriving_partial_eq(cx: &mut ExtCtxt,
                     _ => cx.span_bug(span, "not exactly 2 arguments in `derive(PartialEq)`")
                 };
 
-                let eq = cx.expr_binary(span, ast::BiNe, self_f, other_f.clone());
+                let eq = cx.expr_binary(span, BinOpKind::Ne, self_f, other_f.clone());
 
-                cx.expr_binary(span, ast::BiOr, subexpr, eq)
+                cx.expr_binary(span, BinOpKind::Or, subexpr, eq)
             },
             cx.expr_bool(span, false),
             Box::new(|cx, span, _, _| cx.expr_bool(span, true)),
diff --git a/src/libsyntax_ext/deriving/cmp/partial_ord.rs b/src/libsyntax_ext/deriving/cmp/partial_ord.rs
index 4c10a3a31d0..e857f7d52f9 100644
--- a/src/libsyntax_ext/deriving/cmp/partial_ord.rs
+++ b/src/libsyntax_ext/deriving/cmp/partial_ord.rs
@@ -13,8 +13,7 @@ pub use self::OrderingOp::*;
 use deriving::generic::*;
 use deriving::generic::ty::*;
 
-use syntax::ast;
-use syntax::ast::{MetaItem, Expr};
+use syntax::ast::{MetaItem, Expr, BinOpKind, self};
 use syntax::codemap::Span;
 use syntax::ext::base::{ExtCtxt, Annotatable};
 use syntax::ext::build::AstBuilder;
@@ -161,7 +160,7 @@ pub fn cs_partial_cmp(cx: &mut ExtCtxt, span: Span,
 
             let assign = cx.stmt_let(span, false, test_id, new);
 
-            let cond = cx.expr_binary(span, ast::BiEq,
+            let cond = cx.expr_binary(span, BinOpKind::Eq,
                                       cx.expr_ident(span, test_id),
                                       equals_expr.clone());
             let if_ = cx.expr_if(span,
@@ -183,7 +182,7 @@ pub fn cs_partial_cmp(cx: &mut ExtCtxt, span: Span,
 /// Strict inequality.
 fn cs_op(less: bool, equal: bool, cx: &mut ExtCtxt,
          span: Span, substr: &Substructure) -> P<Expr> {
-    let op = if less {ast::BiLt} else {ast::BiGt};
+    let op = if less { BinOpKind::Lt } else { BinOpKind::Gt };
     cs_fold(
         false, // need foldr,
         |cx, span, subexpr, self_f, other_fs| {
@@ -214,8 +213,8 @@ fn cs_op(less: bool, equal: bool, cx: &mut ExtCtxt,
             let not_cmp = cx.expr_unary(span, ast::UnOp::Not,
                                         cx.expr_binary(span, op, other_f.clone(), self_f));
 
-            let and = cx.expr_binary(span, ast::BiAnd, not_cmp, subexpr);
-            cx.expr_binary(span, ast::BiOr, cmp, and)
+            let and = cx.expr_binary(span, BinOpKind::And, not_cmp, subexpr);
+            cx.expr_binary(span, BinOpKind::Or, cmp, and)
         },
         cx.expr_bool(span, equal),
         Box::new(|cx, span, (self_args, tag_tuple), _non_self_args| {
diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs
index 3af701739b4..9eb516cd07a 100644
--- a/src/libsyntax_ext/deriving/generic/mod.rs
+++ b/src/libsyntax_ext/deriving/generic/mod.rs
@@ -194,8 +194,7 @@ use std::vec;
 
 use syntax::abi::Abi;
 use syntax::abi;
-use syntax::ast;
-use syntax::ast::{EnumDef, Expr, Ident, Generics, VariantData};
+use syntax::ast::{EnumDef, Expr, Ident, Generics, VariantData, BinOpKind, self};
 use syntax::ast_util;
 use syntax::attr;
 use syntax::attr::AttrMetaMethods;
@@ -1279,8 +1278,9 @@ impl<'a> MethodDef<'a> {
                     Some(first) => {
                         let first_expr = cx.expr_ident(sp, first);
                         let id = cx.expr_ident(sp, ident);
-                        let test = cx.expr_binary(sp, ast::BiEq, first_expr, id);
-                        discriminant_test = cx.expr_binary(sp, ast::BiAnd, discriminant_test, test)
+                        let test = cx.expr_binary(sp, BinOpKind::Eq, first_expr, id);
+                        discriminant_test = cx.expr_binary(sp, BinOpKind::And,
+                                                           discriminant_test, test)
                     }
                     None => {
                         first_ident = Some(ident);