1
Fork 0

support creating mutable allocations from byte slices

This commit is contained in:
Ralf Jung 2021-05-23 12:03:39 +02:00
parent c3005e85da
commit 585141b219
8 changed files with 30 additions and 15 deletions

View file

@ -169,8 +169,9 @@ pub(super) fn op_to_const<'tcx>(
(ecx.tcx.global_alloc(ptr.alloc_id).unwrap_memory(), ptr.offset.bytes())
}
Scalar::Int { .. } => (
ecx.tcx
.intern_const_alloc(Allocation::from_byte_aligned_bytes(b"" as &[u8])),
ecx.tcx.intern_const_alloc(Allocation::from_bytes_byte_aligned_immutable(
b"" as &[u8],
)),
0,
),
};