Skip to content

Commit 96ae300

Browse files
committed
CTFE get_alloc_extra_mut: also provide ref to MemoryExtra
1 parent 70cb58c commit 96ae300

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/rustc_mir/src/interpret/memory.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,9 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
673673
pub fn get_alloc_extra_mut<'a>(
674674
&'a mut self,
675675
id: AllocId,
676-
) -> InterpResult<'tcx, &'a mut M::AllocExtra> {
677-
Ok(&mut self.get_raw_mut(id)?.0.extra)
676+
) -> InterpResult<'tcx, (&'a mut M::AllocExtra, &'a mut M::MemoryExtra)> {
677+
let (alloc, memory_extra) = self.get_raw_mut(id)?;
678+
Ok((&mut alloc.extra, memory_extra))
678679
}
679680

680681
/// Obtain the size and alignment of an allocation, even if that allocation has

0 commit comments

Comments
 (0)