Skip to content

Commit a7b7f19

Browse files
author
Ellen Arteca
committed
no more holepunch to bytes
1 parent e0e8e00 commit a7b7f19

File tree

1 file changed

+8
-1
lines changed
  • compiler/rustc_const_eval/src/interpret

1 file changed

+8
-1
lines changed

compiler/rustc_const_eval/src/interpret/memory.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,16 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
518518
)
519519
}
520520

521+
/// Get the base address for the bytes in an `Allocation` specified by the
522+
/// `AllocID` passed in; error if no such allocation exists.
523+
pub fn get_alloc_base_addr(&self, id: AllocId) -> InterpResult<'tcx, Size> {
524+
let alloc = self.get_alloc_raw(id)?;
525+
Ok(alloc.get_bytes_addr())
526+
}
527+
521528
/// Gives raw access to the `Allocation`, without bounds or alignment checks.
522529
/// The caller is responsible for calling the access hooks!
523-
pub fn get_alloc_raw(
530+
fn get_alloc_raw(
524531
&self,
525532
id: AllocId,
526533
) -> InterpResult<'tcx, &Allocation<M::Provenance, M::AllocExtra>> {

0 commit comments

Comments
 (0)