Skip to content

Commit

Permalink
CTFE get_alloc_extra_mut: also provide ref to MemoryExtra
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed May 22, 2021
1 parent 70cb58c commit 96ae300
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/rustc_mir/src/interpret/memory.rs
Expand Up @@ -673,8 +673,9 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
pub fn get_alloc_extra_mut<'a>(
&'a mut self,
id: AllocId,
) -> InterpResult<'tcx, &'a mut M::AllocExtra> {
Ok(&mut self.get_raw_mut(id)?.0.extra)
) -> InterpResult<'tcx, (&'a mut M::AllocExtra, &'a mut M::MemoryExtra)> {
let (alloc, memory_extra) = self.get_raw_mut(id)?;
Ok((&mut alloc.extra, memory_extra))
}

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

0 comments on commit 96ae300

Please sign in to comment.