From f5bd85d009536dfb587991e611ab5211f2bb3f10 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 14 Nov 2018 16:03:38 +0100 Subject: [PATCH] update for memory_deallocated moving to AllocExtra --- src/lib.rs | 9 --------- src/stacked_borrows.rs | 10 +++++----- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index ab34841df89..b7deb8ee116 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -446,15 +446,6 @@ fn adjust_static_allocation( Cow::Owned(alloc) } - #[inline(always)] - fn memory_deallocated( - alloc: &mut Allocation, - ptr: Pointer, - size: Size, - ) -> EvalResult<'tcx> { - alloc.extra.memory_deallocated(ptr, size) - } - #[inline(always)] fn tag_reference( ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>, diff --git a/src/stacked_borrows.rs b/src/stacked_borrows.rs index 475033d74c6..c6cd7f5005d 100644 --- a/src/stacked_borrows.rs +++ b/src/stacked_borrows.rs @@ -363,20 +363,20 @@ fn memory_written<'tcx>( // Writes behave exactly like the first half of a reborrow-to-mut alloc.extra.use_and_maybe_re_borrow(ptr, size, UsageKind::Write, None) } -} -impl<'tcx> Stacks { #[inline(always)] - pub fn memory_deallocated( - &mut self, + fn memory_deallocated<'tcx>( + alloc: &mut Allocation, ptr: Pointer, size: Size, ) -> EvalResult<'tcx> { // This is like mutating - self.use_and_maybe_re_borrow(ptr, size, UsageKind::Write, None) + alloc.extra.use_and_maybe_re_borrow(ptr, size, UsageKind::Write, None) // FIXME: Error out of there are any barriers? } +} +impl<'tcx> Stacks { /// Pushes the first item to the stacks. pub fn first_item( &mut self,