From 980db98b6440779ed714e454f544faf707b2ab9c Mon Sep 17 00:00:00 2001 From: LooMaclin Date: Tue, 9 Apr 2019 00:01:08 +0300 Subject: [PATCH] Improve miri's error reporting in check_in_alloc --- src/librustc/mir/interpret/allocation.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustc/mir/interpret/allocation.rs b/src/librustc/mir/interpret/allocation.rs index ca680187b37d..19f28b96c3a7 100644 --- a/src/librustc/mir/interpret/allocation.rs +++ b/src/librustc/mir/interpret/allocation.rs @@ -378,7 +378,8 @@ impl<'tcx, Tag: Copy, Extra> Allocation { where Extra: AllocationExtra { // get_bytes_unchecked tests relocation edges - let bytes = self.get_bytes_with_undef_and_ptr(cx, ptr, size, CheckInAllocMsg::PointerArithmetic)?; + let bytes = self.get_bytes_with_undef_and_ptr(cx, ptr, size, + CheckInAllocMsg::PointerArithmetic)?; // Undef check happens *after* we established that the alignment is correct. // We must not return Ok() for unaligned pointers! if self.check_defined(ptr, size).is_err() {