Skip to content

Commit d034561

Browse files
committed
Auto merge of #27529 - dotdash:c_u8, r=eddyb
2 parents 0dc2910 + 6e311e7 commit d034561

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

src/librustc_trans/trans/_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,7 @@ pub fn store_local<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
16701670
// Dummy-locals start out uninitialized, so set their
16711671
// drop-flag hints (if any) to "moved."
16721672
if let Some(hint) = kind.dropflag_hint(bcx) {
1673-
let moved_hint = adt::DTOR_MOVED_HINT as usize;
1673+
let moved_hint = adt::DTOR_MOVED_HINT;
16741674
debug!("store moved_hint={} for hint={:?}, uninitialized dummy",
16751675
moved_hint, hint);
16761676
Store(bcx, C_u8(bcx.fcx.ccx, moved_hint), hint.to_value().value());

src/librustc_trans/trans/adt.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -983,15 +983,15 @@ pub fn trans_set_discr<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, r: &Repr<'tcx>,
983983
if dtor_active(dtor) {
984984
let ptr = trans_field_ptr(bcx, r, val, discr,
985985
cases[discr as usize].fields.len() - 2);
986-
Store(bcx, C_u8(bcx.ccx(), DTOR_NEEDED as usize), ptr);
986+
Store(bcx, C_u8(bcx.ccx(), DTOR_NEEDED), ptr);
987987
}
988988
Store(bcx, C_integral(ll_inttype(bcx.ccx(), ity), discr as u64, true),
989989
GEPi(bcx, val, &[0, 0]));
990990
}
991991
Univariant(ref st, dtor) => {
992992
assert_eq!(discr, 0);
993993
if dtor_active(dtor) {
994-
Store(bcx, C_u8(bcx.ccx(), DTOR_NEEDED as usize),
994+
Store(bcx, C_u8(bcx.ccx(), DTOR_NEEDED),
995995
GEPi(bcx, val, &[0, st.fields.len() - 1]));
996996
}
997997
}

src/librustc_trans/trans/base.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ fn memfill<'a, 'tcx>(b: &Builder<'a, 'tcx>, llptr: ValueRef, ty: Ty<'tcx>, byte:
999999

10001000
let llintrinsicfn = ccx.get_intrinsic(&intrinsic_key);
10011001
let llptr = b.pointercast(llptr, Type::i8(ccx).ptr_to());
1002-
let llzeroval = C_u8(ccx, byte as usize);
1002+
let llzeroval = C_u8(ccx, byte);
10031003
let size = machine::llsize_of(ccx, llty);
10041004
let align = C_i32(ccx, type_of::align_of(ccx, ty) as i32);
10051005
let volatile = C_bool(ccx, false);
@@ -1296,7 +1296,7 @@ pub fn init_function<'a, 'tcx>(fcx: &'a FunctionContext<'a, 'tcx>,
12961296
for &info in fragment_infos {
12971297

12981298
let make_datum = |id| {
1299-
let init_val = C_u8(fcx.ccx, adt::DTOR_NEEDED_HINT as usize);
1299+
let init_val = C_u8(fcx.ccx, adt::DTOR_NEEDED_HINT);
13001300
let llname = &format!("dropflag_hint_{}", id);
13011301
debug!("adding hint {}", llname);
13021302
let ptr = alloc_ty(entry_bcx, tcx.types.u8, llname);

src/librustc_trans/trans/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ impl AsU64 for u64 { fn as_u64(self) -> u64 { self as u64 }}
807807
impl AsU64 for u32 { fn as_u64(self) -> u64 { self as u64 }}
808808
impl AsU64 for usize { fn as_u64(self) -> u64 { self as u64 }}
809809

810-
pub fn C_u8(ccx: &CrateContext, i: usize) -> ValueRef {
810+
pub fn C_u8(ccx: &CrateContext, i: u8) -> ValueRef {
811811
C_integral(Type::i8(ccx), i as u64, false)
812812
}
813813

src/librustc_trans/trans/datum.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ impl KindOps for Lvalue {
409409
// aware of drop-hint won't bother calling the
410410
// drop-glue itself.
411411
if let Some(hint_datum) = self.drop_flag_info.hint_datum(bcx) {
412-
let moved_hint_byte = adt::DTOR_MOVED_HINT as usize;
412+
let moved_hint_byte = adt::DTOR_MOVED_HINT;
413413
let hint_llval = hint_datum.to_value().value();
414414
Store(bcx, C_u8(bcx.fcx.ccx, moved_hint_byte), hint_llval);
415415
}

src/librustc_trans/trans/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ fn trans_rvalue_stmt_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
10211021
// its drop-hint (if any) says "initialized."
10221022
if let Some(hint_val) = opt_hint_val {
10231023
let hint_llval = hint_val.value();
1024-
let drop_needed = C_u8(bcx.fcx.ccx, adt::DTOR_NEEDED_HINT as usize);
1024+
let drop_needed = C_u8(bcx.fcx.ccx, adt::DTOR_NEEDED_HINT);
10251025
Store(bcx, drop_needed, hint_llval);
10261026
}
10271027
src_datum.store_to(bcx, dst_datum.val)

0 commit comments

Comments
 (0)