Skip to content

Commit eb4bdb0

Browse files
committed
fix cranelift and gcc
1 parent 3db45f0 commit eb4bdb0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/rustc_codegen_cranelift/src/constant.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant
398398
let bytes = alloc.inspect_with_uninit_and_ptr_outside_interpreter(0..alloc.len()).to_vec();
399399
data_ctx.define(bytes.into_boxed_slice());
400400

401-
for &(offset, alloc_id) in alloc.provenance().iter() {
401+
for &(offset, alloc_id) in alloc.provenance().ptrs().iter() {
402402
let addend = {
403403
let endianness = tcx.data_layout.endian;
404404
let offset = offset.bytes() as usize;
@@ -431,7 +431,7 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant
431431
{
432432
tcx.sess.fatal(&format!(
433433
"Allocation {:?} contains reference to TLS value {:?}",
434-
alloc, def_id
434+
alloc_id, def_id
435435
));
436436
}
437437

compiler/rustc_codegen_gcc/src/consts.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,12 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
297297

298298
pub fn const_alloc_to_gcc<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, alloc: ConstAllocation<'tcx>) -> RValue<'gcc> {
299299
let alloc = alloc.inner();
300-
let mut llvals = Vec::with_capacity(alloc.provenance().len() + 1);
300+
let mut llvals = Vec::with_capacity(alloc.provenance().ptrs().len() + 1);
301301
let dl = cx.data_layout();
302302
let pointer_size = dl.pointer_size.bytes() as usize;
303303

304304
let mut next_offset = 0;
305-
for &(offset, alloc_id) in alloc.provenance().iter() {
305+
for &(offset, alloc_id) in alloc.provenance().ptrs().iter() {
306306
let offset = offset.bytes();
307307
assert_eq!(offset as usize as u64, offset);
308308
let offset = offset as usize;

0 commit comments

Comments
 (0)