about summary refs log tree commit diff
path: root/src/librustc_trans
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-05-13 11:35:59 +0000
committerbors <bors@rust-lang.org>2017-05-13 11:35:59 +0000
commitef3ec5ece5bdf8950810225a9a3bc3cd1926e3d5 (patch)
tree8948bc7cc6fbf6605069fa8e8d9774bc6eac8ab9 /src/librustc_trans
parent453cad6e658e095c6beacf12c589609dac3f4e52 (diff)
parentf28e3cdf54b935d6284bd554e17dc8e44f7b4deb (diff)
downloadrust-ef3ec5ece5bdf8950810225a9a3bc3cd1926e3d5.tar.gz
rust-ef3ec5ece5bdf8950810225a9a3bc3cd1926e3d5.zip
Auto merge of #41965 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 15 pull requests

- Successful merges: #41820, #41860, #41876, #41896, #41912, #41916, #41918, #41921, #41923, #41934, #41935, #41940, #41942, #41943, #41951
- Failed merges:
Diffstat (limited to 'src/librustc_trans')
-rw-r--r--src/librustc_trans/back/msvc/mod.rs1
-rw-r--r--src/librustc_trans/lib.rs3
-rw-r--r--src/librustc_trans/macros.rs29
-rw-r--r--src/librustc_trans/mir/constant.rs7
4 files changed, 6 insertions, 34 deletions
diff --git a/src/librustc_trans/back/msvc/mod.rs b/src/librustc_trans/back/msvc/mod.rs
index 16aef6ee8ca..31f3415b1ec 100644
--- a/src/librustc_trans/back/msvc/mod.rs
+++ b/src/librustc_trans/back/msvc/mod.rs
@@ -32,6 +32,7 @@
 //! comments can also be found below leading through the various code paths.
 
 // A simple macro to make this option mess easier to read
+#[cfg(windows)]
 macro_rules! otry {
     ($expr:expr) => (match $expr {
         Some(val) => val,
diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs
index ff094d04c84..8e633ee59b6 100644
--- a/src/librustc_trans/lib.rs
+++ b/src/librustc_trans/lib.rs
@@ -86,9 +86,6 @@ pub mod back {
 
 pub mod diagnostics;
 
-#[macro_use]
-mod macros;
-
 mod abi;
 mod adt;
 mod asm;
diff --git a/src/librustc_trans/macros.rs b/src/librustc_trans/macros.rs
deleted file mode 100644
index 77efcc6fb00..00000000000
--- a/src/librustc_trans/macros.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-macro_rules! unpack_datum {
-    ($bcx: ident, $inp: expr) => (
-        {
-            let db = $inp;
-            $bcx = db.bcx;
-            db.datum
-        }
-    )
-}
-
-macro_rules! unpack_result {
-    ($bcx: ident, $inp: expr) => (
-        {
-            let db = $inp;
-            $bcx = db.bcx;
-            db.val
-        }
-    )
-}
diff --git a/src/librustc_trans/mir/constant.rs b/src/librustc_trans/mir/constant.rs
index 6ba00c7e103..cd27ddda1b1 100644
--- a/src/librustc_trans/mir/constant.rs
+++ b/src/librustc_trans/mir/constant.rs
@@ -415,8 +415,11 @@ impl<'a, 'tcx> MirConstContext<'a, 'tcx> {
                                           Value(base));
                             }
                             if projected_ty.is_bool() {
-                                unsafe {
-                                    val = llvm::LLVMConstTrunc(val, Type::i1(self.ccx).to_ref());
+                                let i1_type = Type::i1(self.ccx);
+                                if val_ty(val) != i1_type {
+                                    unsafe {
+                                        val = llvm::LLVMConstTrunc(val, i1_type.to_ref());
+                                    }
                                 }
                             }
                             (Base::Value(val), extra)