From e951d8ec0b9055c333485c0f68024b8371f4fa61 Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Thu, 13 Jun 2019 16:52:37 +0200 Subject: [PATCH] Make `Allocation` stable hash robust --- src/librustc/ich/impls_ty.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/librustc/ich/impls_ty.rs b/src/librustc/ich/impls_ty.rs index 9b144b1ba3d2a..b2ad7e923b068 100644 --- a/src/librustc/ich/impls_ty.rs +++ b/src/librustc/ich/impls_ty.rs @@ -175,13 +175,17 @@ impl<'a> HashStable> for mir::interpret::Allocation { hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher, ) { - self.bytes.hash_stable(hcx, hasher); - for reloc in self.relocations.iter() { + let mir::interpret::Allocation { + bytes, relocations, undef_mask, align, mutability, + extra: _, + } = self; + bytes.hash_stable(hcx, hasher); + for reloc in relocations.iter() { reloc.hash_stable(hcx, hasher); } - self.undef_mask.hash_stable(hcx, hasher); - self.align.hash_stable(hcx, hasher); - self.mutability.hash_stable(hcx, hasher); + undef_mask.hash_stable(hcx, hasher); + align.hash_stable(hcx, hasher); + mutability.hash_stable(hcx, hasher); } }