Skip to content

Commit e951d8e

Browse files
committed
Make Allocation stable hash robust
1 parent 4399299 commit e951d8e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/librustc/ich/impls_ty.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,17 @@ impl<'a> HashStable<StableHashingContext<'a>> for mir::interpret::Allocation {
175175
hcx: &mut StableHashingContext<'a>,
176176
hasher: &mut StableHasher<W>,
177177
) {
178-
self.bytes.hash_stable(hcx, hasher);
179-
for reloc in self.relocations.iter() {
178+
let mir::interpret::Allocation {
179+
bytes, relocations, undef_mask, align, mutability,
180+
extra: _,
181+
} = self;
182+
bytes.hash_stable(hcx, hasher);
183+
for reloc in relocations.iter() {
180184
reloc.hash_stable(hcx, hasher);
181185
}
182-
self.undef_mask.hash_stable(hcx, hasher);
183-
self.align.hash_stable(hcx, hasher);
184-
self.mutability.hash_stable(hcx, hasher);
186+
undef_mask.hash_stable(hcx, hasher);
187+
align.hash_stable(hcx, hasher);
188+
mutability.hash_stable(hcx, hasher);
185189
}
186190
}
187191

0 commit comments

Comments
 (0)