Skip to content

Commit 81fd279

Browse files
incr.comp.: Don't filter out StmtDecls from hir::Block during hashing as these make a difference for the RegionScopeTree.
1 parent faad4ea commit 81fd279

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

src/librustc/ich/impls_hir.rs

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -356,33 +356,7 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for hir::Block {
356356
targeted_by_break,
357357
} = *self;
358358

359-
let non_item_stmts = || stmts.iter().filter(|stmt| {
360-
match stmt.node {
361-
hir::StmtDecl(ref decl, _) => {
362-
match decl.node {
363-
// If this is a declaration of a nested item, we don't
364-
// want to leave any trace of it in the hash value, not
365-
// even that it exists. Otherwise changing the position
366-
// of nested items would invalidate the containing item
367-
// even though that does not constitute a semantic
368-
// change.
369-
hir::DeclItem(_) => false,
370-
hir::DeclLocal(_) => true
371-
}
372-
}
373-
hir::StmtExpr(..) |
374-
hir::StmtSemi(..) => true
375-
}
376-
});
377-
378-
let count = non_item_stmts().count();
379-
380-
count.hash_stable(hcx, hasher);
381-
382-
for stmt in non_item_stmts() {
383-
stmt.hash_stable(hcx, hasher);
384-
}
385-
359+
stmts.hash_stable(hcx, hasher);
386360
expr.hash_stable(hcx, hasher);
387361
rules.hash_stable(hcx, hasher);
388362
span.hash_stable(hcx, hasher);

0 commit comments

Comments
 (0)