From f233dc0687143025d375fbc3d3ea64f17ecd7d99 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 11 Nov 2018 10:12:44 +0100 Subject: [PATCH 1/2] Rc should be fixed --- tests/run-pass/rc.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/run-pass/rc.rs b/tests/run-pass/rc.rs index f4a8855bea2..0bf70750311 100644 --- a/tests/run-pass/rc.rs +++ b/tests/run-pass/rc.rs @@ -1,6 +1,3 @@ -// FIXME: Disabled due to https://github.com/rust-lang/rust/issues/55747 -// ignore-test - use std::cell::RefCell; use std::rc::Rc; From e7aa5c68ffc221ee07d37ee1d29b96282729b7fe Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 12 Nov 2018 08:54:12 +0100 Subject: [PATCH 2/2] Update rustc for AllocationExtra trait Based on https://github.com/solson/miri/pull/493 but there were more conflicts than code so I opted not to cherry-pick. --- rust-version | 2 +- src/lib.rs | 18 ------------------ src/stacked_borrows.rs | 19 +++++++++++-------- 3 files changed, 12 insertions(+), 27 deletions(-) diff --git a/rust-version b/rust-version index 0ad81587241..fb6d167ec64 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -nightly-2018-11-08 +nightly-2018-11-12 diff --git a/src/lib.rs b/src/lib.rs index 134986c814d..ab34841df89 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -446,24 +446,6 @@ fn adjust_static_allocation( Cow::Owned(alloc) } - #[inline(always)] - fn memory_read( - alloc: &Allocation, - ptr: Pointer, - size: Size, - ) -> EvalResult<'tcx> { - alloc.extra.memory_read(ptr, size) - } - - #[inline(always)] - fn memory_written( - alloc: &mut Allocation, - ptr: Pointer, - size: Size, - ) -> EvalResult<'tcx> { - alloc.extra.memory_written(ptr, size) - } - #[inline(always)] fn memory_deallocated( alloc: &mut Allocation, diff --git a/src/stacked_borrows.rs b/src/stacked_borrows.rs index e1abcb20af7..475033d74c6 100644 --- a/src/stacked_borrows.rs +++ b/src/stacked_borrows.rs @@ -5,7 +5,7 @@ use crate::{ EvalResult, MiriEvalContext, HelpersEvalContextExt, - MemoryKind, MiriMemoryKind, RangeMap, AllocId, + MemoryKind, MiriMemoryKind, RangeMap, AllocId, Allocation, AllocationExtra, Pointer, PlaceTy, MPlaceTy, }; @@ -343,27 +343,30 @@ fn check_frozen( } /// Hooks and glue -impl<'tcx> Stacks { +impl AllocationExtra for Stacks { #[inline(always)] - pub fn memory_read( - &self, + fn memory_read<'tcx>( + alloc: &Allocation, ptr: Pointer, size: Size, ) -> EvalResult<'tcx> { // Reads behave exactly like the first half of a reborrow-to-shr - self.use_and_maybe_re_borrow(ptr, size, UsageKind::Read, None) + alloc.extra.use_and_maybe_re_borrow(ptr, size, UsageKind::Read, None) } #[inline(always)] - pub fn memory_written( - &mut self, + fn memory_written<'tcx>( + alloc: &mut Allocation, ptr: Pointer, size: Size, ) -> EvalResult<'tcx> { // Writes behave exactly like the first half of a reborrow-to-mut - self.use_and_maybe_re_borrow(ptr, size, UsageKind::Write, None) + alloc.extra.use_and_maybe_re_borrow(ptr, size, UsageKind::Write, None) } +} +impl<'tcx> Stacks { + #[inline(always)] pub fn memory_deallocated( &mut self, ptr: Pointer,