interpret/allocation: make alloc fn be FnOnce

This commit is contained in:
Nia Espera 2025-05-28 13:04:37 +02:00
parent cb678b94c3
commit bcebf58acc
No known key found for this signature in database
GPG key ID: E7A3AAA3B692EAD7

View file

@ -512,7 +512,7 @@ impl Allocation {
pub fn adjust_from_tcx<'tcx, Prov: Provenance, Bytes: AllocBytes>(
&self,
cx: &impl HasDataLayout,
mut alloc_bytes: impl FnMut(&[u8], Align) -> InterpResult<'tcx, Bytes>,
alloc_bytes: impl FnOnce(&[u8], Align) -> InterpResult<'tcx, Bytes>,
mut adjust_ptr: impl FnMut(Pointer<CtfeProvenance>) -> InterpResult<'tcx, Pointer<Prov>>,
) -> InterpResult<'tcx, Allocation<Prov, (), Bytes>> {
// Copy the data.