about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJakub Wieczorek <jakub@jakub.cc>2014-06-08 20:01:38 +0200
committerJakub Wieczorek <jakub@jakub.cc>2014-06-08 20:01:38 +0200
commitf8b4e821ea856d84f1521ea82148bd108c8faba2 (patch)
tree1668256f83002c22c3d29efaa798d8b0c4b7d762 /src
parenta2bbcb594fff51ecad2f9077467a29a6b2713319 (diff)
downloadrust-f8b4e821ea856d84f1521ea82148bd108c8faba2.tar.gz
rust-f8b4e821ea856d84f1521ea82148bd108c8faba2.zip
Remove a redundant bitcast from fail!() handling
Diffstat (limited to 'src')
-rw-r--r--src/librustc/middle/trans/controlflow.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/librustc/middle/trans/controlflow.rs b/src/librustc/middle/trans/controlflow.rs
index ea152c34808..a6290a8edb4 100644
--- a/src/librustc/middle/trans/controlflow.rs
+++ b/src/librustc/middle/trans/controlflow.rs
@@ -20,7 +20,6 @@ use middle::trans::cleanup;
 use middle::trans::common::*;
 use middle::trans::debuginfo;
 use middle::trans::expr;
-use middle::trans::type_of;
 use middle::ty;
 use util::ppaux::Repr;
 
@@ -343,14 +342,10 @@ pub fn trans_ret<'a>(bcx: &'a Block<'a>,
 
 fn str_slice_arg<'a>(bcx: &'a Block<'a>, s: InternedString) -> ValueRef {
     let ccx = bcx.ccx();
-    let t = ty::mk_str_slice(bcx.tcx(), ty::ReStatic, ast::MutImmutable);
     let s = C_str_slice(ccx, s);
     let slot = alloca(bcx, val_ty(s), "__temp");
     Store(bcx, s, slot);
-
-    // The type of C_str_slice is { i8*, i64 }, but the type of the &str is
-    // %str_slice, so we do a bitcast here to the right type.
-    BitCast(bcx, slot, type_of::type_of(ccx, t).ptr_to())
+    slot
 }
 
 pub fn trans_fail<'a>(