From 34e92bbf65aa28a8192dfc0ca1edaaee95d52b37 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Thu, 11 Mar 2021 12:31:31 +0100 Subject: [PATCH] Hash SyntaxContext first. --- compiler/rustc_span/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index 1a2e87d28aca..6030c8a86d9f 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -1902,9 +1902,10 @@ where return; } + self.ctxt().hash_stable(ctx, hasher); + if self.is_dummy() { Hash::hash(&TAG_INVALID_SPAN, hasher); - self.ctxt().hash_stable(ctx, hasher); return; } @@ -1917,7 +1918,6 @@ where Some(pos) => pos, None => { Hash::hash(&TAG_INVALID_SPAN, hasher); - span.ctxt.hash_stable(ctx, hasher); return; } }; @@ -1944,7 +1944,6 @@ where let len = (span.hi - span.lo).0; Hash::hash(&col_line, hasher); Hash::hash(&len, hasher); - span.ctxt.hash_stable(ctx, hasher); } }