Skip to content

Commit 67a2192

Browse files
committed
Stop requiring a type when codegenning types. We can get all the type info we need from the ConstAllocation
1 parent 27a6798 commit 67a2192

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

compiler/rustc_codegen_llvm/src/consts.rs

+3-10
Original file line numberDiff line numberDiff line change
@@ -354,18 +354,11 @@ impl<'ll> CodegenCx<'ll, '_> {
354354
};
355355
let alloc = alloc.inner();
356356

357-
let instance = Instance::mono(self.tcx, def_id);
358-
let ty = instance.ty(self.tcx, ty::ParamEnv::reveal_all());
359-
if !self.tcx.is_mutable_static(def_id) {
360-
debug_assert_eq!(alloc.mutability.is_not(), self.type_is_freeze(ty));
361-
}
362-
debug_assert_eq!(alloc.align, self.align_of(ty));
363-
let llty = self.layout_of(ty).llvm_type(self);
364-
365-
let g = self.get_static_inner(def_id, llty);
366-
367357
let val_llty = self.val_ty(v);
368358

359+
let g = self.get_static_inner(def_id, val_llty);
360+
let llty = self.val_ty(g);
361+
369362
let g = if val_llty == llty {
370363
g
371364
} else {

0 commit comments

Comments
 (0)