about summary refs log tree commit diff
path: root/src/libsyntax/ext/deriving/cmp
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-05-12 00:25:31 -0400
committerAlex Crichton <alex@alexcrichton.com>2013-05-14 12:24:43 -0400
commit92d39fe4d5e5ad3d2c2dcafe45eaf6e23edddfd7 (patch)
tree817ebba2489c228d8494662b4ce188e0782b321a /src/libsyntax/ext/deriving/cmp
parent2951527528b39dbf47c02b3d329129d677ddcdfd (diff)
downloadrust-92d39fe4d5e5ad3d2c2dcafe45eaf6e23edddfd7.tar.gz
rust-92d39fe4d5e5ad3d2c2dcafe45eaf6e23edddfd7.zip
syntax: Remove #[allow(vecs_implicitly_copyable)]
Diffstat (limited to 'src/libsyntax/ext/deriving/cmp')
-rw-r--r--src/libsyntax/ext/deriving/cmp/ord.rs4
-rw-r--r--src/libsyntax/ext/deriving/cmp/totalord.rs9
2 files changed, 7 insertions, 6 deletions
diff --git a/src/libsyntax/ext/deriving/cmp/ord.rs b/src/libsyntax/ext/deriving/cmp/ord.rs
index a9234c858f4..cdb9f620301 100644
--- a/src/libsyntax/ext/deriving/cmp/ord.rs
+++ b/src/libsyntax/ext/deriving/cmp/ord.rs
@@ -65,8 +65,6 @@ fn cs_ord(less: bool, equal: bool,
     let false_blk_expr = build::mk_block(cx, span,
                                          ~[], ~[],
                                          Some(build::mk_bool(cx, span, false)));
-    let true_blk = build::mk_simple_block(cx, span,
-                                          build::mk_bool(cx, span, true));
     let base = build::mk_bool(cx, span, equal);
 
     cs_fold(
@@ -108,6 +106,8 @@ fn cs_ord(less: bool, equal: bool,
 
             let cmp = build::mk_method_call(cx, span,
                                             self_f, binop, other_fs.to_owned());
+            let true_blk = build::mk_simple_block(cx, span,
+                                                  build::mk_bool(cx, span, true));
             let if_ = expr_if(cmp, true_blk, Some(elseif));
 
             build::mk_expr(cx, span, if_)
diff --git a/src/libsyntax/ext/deriving/cmp/totalord.rs b/src/libsyntax/ext/deriving/cmp/totalord.rs
index 7d560a197d0..5ec4e028454 100644
--- a/src/libsyntax/ext/deriving/cmp/totalord.rs
+++ b/src/libsyntax/ext/deriving/cmp/totalord.rs
@@ -55,15 +55,16 @@ pub fn ordering_const(cx: @ext_ctxt, span: span, cnst: Ordering) -> @expr {
 
 pub fn cs_cmp(cx: @ext_ctxt, span: span,
               substr: &Substructure) -> @expr {
-    let lexical_ord = ~[cx.ident_of("core"),
-                        cx.ident_of("cmp"),
-                        cx.ident_of("lexical_ordering")];
 
     cs_same_method_fold(
         // foldr (possibly) nests the matches in lexical_ordering better
         false,
         |cx, span, old, new| {
-            build::mk_call_global(cx, span, lexical_ord, ~[old, new])
+            build::mk_call_global(cx, span,
+                                  ~[cx.ident_of("core"),
+                                    cx.ident_of("cmp"),
+                                    cx.ident_of("lexical_ordering")],
+                                  ~[old, new])
         },
         ordering_const(cx, span, Equal),
         |cx, span, list, _| {