mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
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.
This commit is contained in:
parent
4278b5f03b
commit
38d627fe48
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user