about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/consts.rs
diff options
context:
space:
mode:
authorOli Scherer <github333195615777966@oli-obk.de>2025-03-12 10:26:37 +0000
committerOli Scherer <github333195615777966@oli-obk.de>2025-07-09 16:37:11 +0000
commit486ffda9dcd0d4ef0a09d81e6ce5f241e77526a1 (patch)
tree6016dd4aa95f8637e464cda9688a84c5a1002bc4 /compiler/rustc_codegen_llvm/src/consts.rs
parent6b3ae3f6e45a33c2d95fa0362c9b2593e567fd34 (diff)
downloadrust-486ffda9dcd0d4ef0a09d81e6ce5f241e77526a1.tar.gz
rust-486ffda9dcd0d4ef0a09d81e6ce5f241e77526a1.zip
Add opaque TypeId handles for CTFE
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/consts.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/consts.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_llvm/src/consts.rs b/compiler/rustc_codegen_llvm/src/consts.rs
index 28f5282c6b0..21524fd2eb8 100644
--- a/compiler/rustc_codegen_llvm/src/consts.rs
+++ b/compiler/rustc_codegen_llvm/src/consts.rs
@@ -27,10 +27,9 @@ use crate::{base, debuginfo};
 
 pub(crate) fn const_alloc_to_llvm<'ll>(
     cx: &CodegenCx<'ll, '_>,
-    alloc: ConstAllocation<'_>,
+    alloc: &Allocation,
     is_static: bool,
 ) -> &'ll Value {
-    let alloc = alloc.inner();
     // We expect that callers of const_alloc_to_llvm will instead directly codegen a pointer or
     // integer for any &ZST where the ZST is a constant (i.e. not a static). We should never be
     // producing empty LLVM allocations as they're just adding noise to binaries and forcing less
@@ -141,7 +140,7 @@ fn codegen_static_initializer<'ll, 'tcx>(
     def_id: DefId,
 ) -> Result<(&'ll Value, ConstAllocation<'tcx>), ErrorHandled> {
     let alloc = cx.tcx.eval_static_initializer(def_id)?;
-    Ok((const_alloc_to_llvm(cx, alloc, /*static*/ true), alloc))
+    Ok((const_alloc_to_llvm(cx, alloc.inner(), /*static*/ true), alloc))
 }
 
 fn set_global_alignment<'ll>(cx: &CodegenCx<'ll, '_>, gv: &'ll Value, mut align: Align) {