mirror of
https://github.com/rust-lang/rust
synced 2024-07-21 10:26:41 +00:00
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
|
@ -354,18 +354,11 @@ fn codegen_static_item(&self, def_id: DefId) {
|
|||
};
|
||||
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…
Reference in a new issue