diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-02-23 16:06:04 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-03-12 05:53:46 +0000 |
| commit | 12e2846514b4caf54430e1a7fc84626d2c39928f (patch) | |
| tree | 27af577f4b3c6a151570080f1b2c987bb87d5a3a /compiler/rustc_codegen_llvm/src | |
| parent | 0ef52380a58d7224fac71cc36e9e4c0dc99aec33 (diff) | |
| download | rust-12e2846514b4caf54430e1a7fc84626d2c39928f.tar.gz rust-12e2846514b4caf54430e1a7fc84626d2c39928f.zip | |
Stop requiring a type when codegenning types. We can get all the type info we need from the `ConstAllocation`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/consts.rs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/compiler/rustc_codegen_llvm/src/consts.rs b/compiler/rustc_codegen_llvm/src/consts.rs index 4dde7ec9cf3..8acb3de8867 100644 --- a/compiler/rustc_codegen_llvm/src/consts.rs +++ b/compiler/rustc_codegen_llvm/src/consts.rs @@ -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 { |
