Skip to content

Commit 38d627f

Browse files
committed
Use the right type for drop flag datums
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.
1 parent 4278b5f commit 38d627f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/librustc_trans/trans/base.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,12 +1299,11 @@ pub fn init_function<'a, 'tcx>(fcx: &'a FunctionContext<'a, 'tcx>,
12991299
let init_val = C_u8(fcx.ccx, adt::DTOR_NEEDED_HINT);
13001300
let llname = &format!("dropflag_hint_{}", id);
13011301
debug!("adding hint {}", llname);
1302-
let ptr = alloc_ty(entry_bcx, tcx.types.u8, llname);
1302+
let ty = tcx.types.u8;
1303+
let ptr = alloc_ty(entry_bcx, ty, llname);
13031304
Store(entry_bcx, init_val, ptr);
1304-
let ty = tcx.mk_ptr(ty::TypeAndMut { ty: tcx.types.u8, mutbl: ast::MutMutable });
13051305
let flag = datum::Lvalue::new_dropflag_hint("base::init_function");
1306-
let datum = datum::Datum::new(ptr, ty, flag);
1307-
datum
1306+
datum::Datum::new(ptr, ty, flag)
13081307
};
13091308

13101309
let (var, datum) = match info {

0 commit comments

Comments
 (0)