We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
ConstAllocation
1 parent 27a6798 commit 67a2192Copy full SHA for 67a2192
compiler/rustc_codegen_llvm/src/consts.rs
@@ -354,18 +354,11 @@ impl<'ll> CodegenCx<'ll, '_> {
354
};
355
let alloc = alloc.inner();
356
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
367
let val_llty = self.val_ty(v);
368
+ let g = self.get_static_inner(def_id, val_llty);
+ let llty = self.val_ty(g);
+
369
let g = if val_llty == llty {
370
g
371
} else {
0 commit comments