Stop requiring a type when codegenning types. We can get all the type info we need from the ConstAllocation
This commit is contained in:
parent
0ef52380a5
commit
12e2846514
1 changed files with 3 additions and 10 deletions
|
@ -354,18 +354,11 @@ impl<'ll> CodegenCx<'ll, '_> {
|
|||
};
|
||||
let alloc = alloc.inner();
|
||||
|
||||
let instance = Instance::mono(self.tcx, def_id);
|
||||
let ty = instance.ty(self.tcx, ty::ParamEnv::reveal_all());
|
||||
if !self.tcx.is_mutable_static(def_id) {
|
||||
debug_assert_eq!(alloc.mutability.is_not(), self.type_is_freeze(ty));
|
||||
}
|
||||
debug_assert_eq!(alloc.align, self.align_of(ty));
|
||||
let llty = self.layout_of(ty).llvm_type(self);
|
||||
|
||||
let g = self.get_static_inner(def_id, llty);
|
||||
|
||||
let val_llty = self.val_ty(v);
|
||||
|
||||
let g = self.get_static_inner(def_id, val_llty);
|
||||
let llty = self.val_ty(g);
|
||||
|
||||
let g = if val_llty == llty {
|
||||
g
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue