about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/common.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-07-28 13:44:11 +0200
committerRalf Jung <post@ralfj.de>2019-08-02 23:02:53 +0200
commite590b849b83dd97fe98a39971cd91b692a0cf2a8 (patch)
tree622391b54d6779c4065cbf9822956f0effd19ae4 /src/librustc_codegen_llvm/common.rs
parentcf048cc115860cc110865f460f3f2b9b4308ad92 (diff)
downloadrust-e590b849b83dd97fe98a39971cd91b692a0cf2a8.tar.gz
rust-e590b849b83dd97fe98a39971cd91b692a0cf2a8.zip
CTFE: simplify Value type by not checking for alignment
Diffstat (limited to 'src/librustc_codegen_llvm/common.rs')
-rw-r--r--src/librustc_codegen_llvm/common.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_codegen_llvm/common.rs b/src/librustc_codegen_llvm/common.rs
index f00624f3811..19b051a4f38 100644
--- a/src/librustc_codegen_llvm/common.rs
+++ b/src/librustc_codegen_llvm/common.rs
@@ -11,7 +11,7 @@ use crate::value::Value;
 use rustc_codegen_ssa::traits::*;
 
 use crate::consts::const_alloc_to_llvm;
-use rustc::ty::layout::{HasDataLayout, LayoutOf, self, TyLayout, Size, Align};
+use rustc::ty::layout::{HasDataLayout, LayoutOf, self, TyLayout, Size};
 use rustc::mir::interpret::{Scalar, GlobalAlloc, Allocation};
 use rustc_codegen_ssa::mir::place::PlaceRef;
 
@@ -329,10 +329,10 @@ impl ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
     fn from_const_alloc(
         &self,
         layout: TyLayout<'tcx>,
-        align: Align,
         alloc: &Allocation,
         offset: Size,
     ) -> PlaceRef<'tcx, &'ll Value> {
+        let align = alloc.align; // follow what CTFE did, not what the layout says
         let init = const_alloc_to_llvm(self, alloc);
         let base_addr = self.static_addr_of(init, align, None);