about summary refs log tree commit diff
path: root/compiler/rustc_mir/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2021-05-22 15:20:20 +0200
committerRalf Jung <post@ralfj.de>2021-05-22 15:20:20 +0200
commit96ae3008891bc37976c4d33f2d1695bcb6af461c (patch)
treebbb543576ed816f63d9557354fd08fe7fd760d10 /compiler/rustc_mir/src
parent70cb58ce279444ac0191c4aa6df79becbaf2bdc1 (diff)
downloadrust-96ae3008891bc37976c4d33f2d1695bcb6af461c.tar.gz
rust-96ae3008891bc37976c4d33f2d1695bcb6af461c.zip
CTFE get_alloc_extra_mut: also provide ref to MemoryExtra
Diffstat (limited to 'compiler/rustc_mir/src')
-rw-r--r--compiler/rustc_mir/src/interpret/memory.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_mir/src/interpret/memory.rs b/compiler/rustc_mir/src/interpret/memory.rs
index 7fb7c51b0b5..d45ea352028 100644
--- a/compiler/rustc_mir/src/interpret/memory.rs
+++ b/compiler/rustc_mir/src/interpret/memory.rs
@@ -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