Skip to content

Commit 7388cb4

Browse files
committed
Fixup remaining direct relocation field references
1 parent bee2d37 commit 7388cb4

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/librustc_codegen_llvm/consts.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ use rustc::hir::{self, CodegenFnAttrs, CodegenFnAttrFlags};
2525
use std::ffi::{CStr, CString};
2626

2727
pub fn const_alloc_to_llvm(cx: &CodegenCx<'ll, '_>, alloc: &Allocation) -> &'ll Value {
28-
let mut llvals = Vec::with_capacity(alloc.relocations.len() + 1);
28+
let mut llvals = Vec::with_capacity(alloc.relocations().len() + 1);
2929
let dl = cx.data_layout();
3030
let pointer_size = dl.pointer_size.bytes() as usize;
3131

3232
let mut next_offset = 0;
33-
for &(offset, ((), alloc_id)) in alloc.relocations.iter() {
33+
for &(offset, ((), alloc_id)) in alloc.relocations().iter() {
3434
let offset = offset.bytes();
3535
assert_eq!(offset as usize as u64, offset);
3636
let offset = offset as usize;
@@ -455,7 +455,7 @@ impl StaticMethods for CodegenCx<'ll, 'tcx> {
455455
//
456456
// We could remove this hack whenever we decide to drop macOS 10.10 support.
457457
if self.tcx.sess.target.target.options.is_like_osx {
458-
assert_eq!(alloc.relocations.len(), 0);
458+
assert_eq!(alloc.relocations().len(), 0);
459459

460460
let is_zeroed = {
461461
// Treats undefined bytes as if they were defined with the byte value that
@@ -490,7 +490,7 @@ impl StaticMethods for CodegenCx<'ll, 'tcx> {
490490
section.as_str().as_ptr() as *const _,
491491
section.as_str().len() as c_uint,
492492
);
493-
assert!(alloc.relocations.is_empty());
493+
assert!(alloc.relocations().is_empty());
494494

495495
// The `inspect` method is okay here because we checked relocations, and
496496
// because we are doing this access to inspect the final interpreter state (not

src/librustc_mir/interpret/snapshot.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ impl<'a, Ctx> Snapshot<'a, Ctx> for &'a Allocation
287287

288288
fn snapshot(&self, ctx: &'a Ctx) -> Self::Item {
289289
let Allocation {
290-
relocations,
291290
size,
292291
align,
293292
mutability,
@@ -300,7 +299,9 @@ impl<'a, Ctx> Snapshot<'a, Ctx> for &'a Allocation
300299
// influence interpreter exeuction, but only to detect the error of cycles in evalution
301300
// dependencies.
302301
let bytes = self.inspect_with_undef_and_ptr_outside_interpreter(all_bytes);
302+
303303
let undef_mask = self.undef_mask();
304+
let relocations = self.relocations();
304305

305306
AllocationSnapshot {
306307
bytes,

0 commit comments

Comments
 (0)