Rollup merge of #141513 - nia-e:allocbytes-extend, r=RalfJung

interpret: add allocation parameters to `AllocBytes`

Necessary for a better implementation of [rust-lang/miri#4343](https://github.com/rust-lang/miri/pull/4343). Also included here is the code from that PR, adapted to this new interface for the sake of example and so that CI can run on them; the Miri changes can be reverted and merged separately, though.

r? `@RalfJung`
This commit is contained in:
许杰友 Jieyou Xu (Joe)
2025-05-27 01:29:20 +08:00
committed by GitHub
16 changed files with 81 additions and 34 deletions

View File

@@ -197,4 +197,9 @@ impl<'tcx> interpret::Machine<'tcx> for DummyMachine {
) -> &'a mut Vec<interpret::Frame<'tcx, Self::Provenance, Self::FrameExtra>> {
unimplemented!()
}
fn get_default_alloc_params(
&self,
) -> <Self::Bytes as rustc_middle::mir::interpret::AllocBytes>::AllocParams {
}
}

View File

@@ -735,6 +735,9 @@ impl<'tcx> interpret::Machine<'tcx> for CompileTimeMachine<'tcx> {
Cow::Owned(compute_range())
}
}
fn get_default_alloc_params(&self) -> <Self::Bytes as mir::interpret::AllocBytes>::AllocParams {
}
}
// Please do not add any code below the above `Machine` trait impl. I (oli-obk) plan more cleanups