about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-05-29 04:49:45 +0200
committerGitHub <noreply@github.com>2025-05-29 04:49:45 +0200
commite987a99ed291c0d2301a5e8d9cb5f6c45bdce25a (patch)
treec864b45d65528b0aa735ccffbef80c84fb81d17e
parentbab9879932a0970ff3e2d4b4fe049b4835932fc5 (diff)
parentbcebf58accb50f2252a1bf728a8da2316a1c1e48 (diff)
downloadrust-e987a99ed291c0d2301a5e8d9cb5f6c45bdce25a.tar.gz
rust-e987a99ed291c0d2301a5e8d9cb5f6c45bdce25a.zip
Rollup merge of #141682 - nia-e:fixup-alloc, r=RalfJung
interpret/allocation: Fixup type for `alloc_bytes`

This can be `FnOnce`, which helps us avoid an extra clone in rust-lang/miri#4343

r? RalfJung
-rw-r--r--compiler/rustc_middle/src/mir/interpret/allocation.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/mir/interpret/allocation.rs b/compiler/rustc_middle/src/mir/interpret/allocation.rs
index f17747558fc..dd55d039794 100644
--- a/compiler/rustc_middle/src/mir/interpret/allocation.rs
+++ b/compiler/rustc_middle/src/mir/interpret/allocation.rs
@@ -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.