about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-08-06 10:46:26 +0000
committerbors <bors@rust-lang.org>2015-08-06 10:46:26 +0000
commit8f3901feabf6c9072e533ae69b14b5761909f642 (patch)
treefe5c317f4beac78bc43cb020894e69e327adde49
parent859d2954ed974e4d81ea4c20140f6f15f4c6077e (diff)
parent38d627fe480c92e6123cff7c2f050b1943c89d64 (diff)
downloadrust-8f3901feabf6c9072e533ae69b14b5761909f642.tar.gz
rust-8f3901feabf6c9072e533ae69b14b5761909f642.zip
Auto merge of #27555 - dotdash:drop_flag_ty, r=pnkfelix
The drop flags are Lvalue (and thus ByRef) datums that hold a u8 value,
so their value type should be u8, not a pointer to u8.
-rw-r--r--src/librustc_trans/trans/base.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs
index adc678f2c0e..7d2185f03fe 100644
--- a/src/librustc_trans/trans/base.rs
+++ b/src/librustc_trans/trans/base.rs
@@ -1299,12 +1299,11 @@ pub fn init_function<'a, 'tcx>(fcx: &'a FunctionContext<'a, 'tcx>,
                 let init_val = C_u8(fcx.ccx, adt::DTOR_NEEDED_HINT);
                 let llname = &format!("dropflag_hint_{}", id);
                 debug!("adding hint {}", llname);
-                let ptr = alloc_ty(entry_bcx, tcx.types.u8, llname);
+                let ty = tcx.types.u8;
+                let ptr = alloc_ty(entry_bcx, ty, llname);
                 Store(entry_bcx, init_val, ptr);
-                let ty = tcx.mk_ptr(ty::TypeAndMut { ty: tcx.types.u8, mutbl: ast::MutMutable });
                 let flag = datum::Lvalue::new_dropflag_hint("base::init_function");
-                let datum = datum::Datum::new(ptr, ty, flag);
-                datum
+                datum::Datum::new(ptr, ty, flag)
             };
 
             let (var, datum) = match info {