]> git.proxmox.com Git - rustc.git/blobdiff - src/librustc_codegen_llvm/mir/constant.rs
New upstream version 1.31.0~beta.4+dfsg1
[rustc.git] / src / librustc_codegen_llvm / mir / constant.rs
index b6c9658dd6fc36f67fe5c0cef76e43d7464c4a62..9f0f744389089c56981a35d1a08a55be3dc4ec32 100644 (file)
@@ -10,7 +10,7 @@
 
 use llvm;
 use rustc::mir::interpret::{ConstEvalErr, read_target_uint};
-use rustc_mir::interpret::{const_field};
+use rustc_mir::const_eval::const_field;
 use rustc::hir::def_id::DefId;
 use rustc::mir;
 use rustc_data_structures::indexed_vec::Idx;
@@ -92,7 +92,7 @@ pub fn const_alloc_to_llvm(cx: &CodegenCx<'ll, '_>, alloc: &Allocation) -> &'ll
     let pointer_size = layout.pointer_size.bytes() as usize;
 
     let mut next_offset = 0;
-    for &(offset, alloc_id) in alloc.relocations.iter() {
+    for &(offset, ((), alloc_id)) in alloc.relocations.iter() {
         let offset = offset.bytes();
         assert_eq!(offset as usize as u64, offset);
         let offset = offset as usize;
@@ -105,7 +105,7 @@ pub fn const_alloc_to_llvm(cx: &CodegenCx<'ll, '_>, alloc: &Allocation) -> &'ll
         ).expect("const_alloc_to_llvm: could not read relocation pointer") as u64;
         llvals.push(scalar_to_llvm(
             cx,
-            Pointer { alloc_id, offset: Size::from_bytes(ptr_offset) }.into(),
+            Pointer::new(alloc_id, Size::from_bytes(ptr_offset)).into(),
             &layout::Scalar {
                 value: layout::Primitive::Pointer,
                 valid_range: 0..=!0