diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2023-10-13 20:20:57 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2025-07-23 23:54:37 +0000 |
| commit | 9ff071219bca913e45235568defadd5ab840c50a (patch) | |
| tree | b99f32ff1b7329862353a72f07e382f5fcfb1cac /compiler/rustc_codegen_ssa/src | |
| parent | ace633090349fc5075b5b0d56294de985e7d1191 (diff) | |
| download | rust-9ff071219bca913e45235568defadd5ab840c50a.tar.gz rust-9ff071219bca913e45235568defadd5ab840c50a.zip | |
Give an AllocId to ConstValue::Slice.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/operand.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/operand.rs b/compiler/rustc_codegen_ssa/src/mir/operand.rs index 06bedaaa4a2..41cdd4dd980 100644 --- a/compiler/rustc_codegen_ssa/src/mir/operand.rs +++ b/compiler/rustc_codegen_ssa/src/mir/operand.rs @@ -154,14 +154,11 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> { OperandValue::Immediate(llval) } ConstValue::ZeroSized => return OperandRef::zero_sized(layout), - ConstValue::Slice { data, meta } => { + ConstValue::Slice { alloc_id, meta, phantom: _ } => { let BackendRepr::ScalarPair(a_scalar, _) = layout.backend_repr else { bug!("from_const: invalid ScalarPair layout: {:#?}", layout); }; - let a = Scalar::from_pointer( - Pointer::new(bx.tcx().reserve_and_set_memory_alloc(data).into(), Size::ZERO), - &bx.tcx(), - ); + let a = Scalar::from_pointer(Pointer::new(alloc_id.into(), Size::ZERO), &bx.tcx()); let a_llval = bx.scalar_to_backend( a, a_scalar, |
