From 11464e714a670c6304cd00d20c0e31cc66290866 Mon Sep 17 00:00:00 2001 From: LooMaclin Date: Tue, 9 Apr 2019 00:42:45 +0300 Subject: [PATCH] Improve miri's error reporting in check_in_alloc --- src/librustc_mir/interpret/memory.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustc_mir/interpret/memory.rs b/src/librustc_mir/interpret/memory.rs index 6475eac41e3a..3c7cded5ba60 100644 --- a/src/librustc_mir/interpret/memory.rs +++ b/src/librustc_mir/interpret/memory.rs @@ -252,7 +252,8 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> { Scalar::Ptr(ptr) => { // check this is not NULL -- which we can ensure only if this is in-bounds // of some (potentially dead) allocation. - let align = self.check_bounds_ptr(ptr, InboundsCheck::MaybeDead, CheckInAllocMsg::NullPointer)?; + let align = self.check_bounds_ptr(ptr, InboundsCheck::MaybeDead, + CheckInAllocMsg::NullPointer)?; (ptr.offset.bytes(), align) } Scalar::Bits { bits, size } => {