From 81fd279e815011a1b689fc49eceb761a0a6aef74 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Tue, 7 Nov 2017 15:18:00 +0100 Subject: [PATCH] incr.comp.: Don't filter out StmtDecls from hir::Block during hashing as these make a difference for the RegionScopeTree. --- src/librustc/ich/impls_hir.rs | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/src/librustc/ich/impls_hir.rs b/src/librustc/ich/impls_hir.rs index f0fe6205fb6d..6b78cd473be8 100644 --- a/src/librustc/ich/impls_hir.rs +++ b/src/librustc/ich/impls_hir.rs @@ -356,33 +356,7 @@ impl<'gcx> HashStable> for hir::Block { targeted_by_break, } = *self; - let non_item_stmts = || stmts.iter().filter(|stmt| { - match stmt.node { - hir::StmtDecl(ref decl, _) => { - match decl.node { - // If this is a declaration of a nested item, we don't - // want to leave any trace of it in the hash value, not - // even that it exists. Otherwise changing the position - // of nested items would invalidate the containing item - // even though that does not constitute a semantic - // change. - hir::DeclItem(_) => false, - hir::DeclLocal(_) => true - } - } - hir::StmtExpr(..) | - hir::StmtSemi(..) => true - } - }); - - let count = non_item_stmts().count(); - - count.hash_stable(hcx, hasher); - - for stmt in non_item_stmts() { - stmt.hash_stable(hcx, hasher); - } - + stmts.hash_stable(hcx, hasher); expr.hash_stable(hcx, hasher); rules.hash_stable(hcx, hasher); span.hash_stable(hcx, hasher);