Auto merge of #85578 - RalfJung:alloc-mem-extra, r=oli-obk
CTFE get_alloc_extra_mut: also provide ref to MemoryExtra This would let me use mutable references in more places in Stacked Borrows, avoiding some `RefCell` overhead. :) r? `@oli-obk`
This commit is contained in:
commit
e4ca1662f2
@ -673,8 +673,9 @@ pub fn get_mut<'a>(
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user