Skip to content

Commit

Permalink
Hash SyntaxContext first.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Mar 11, 2021
1 parent fe2d728 commit 34e92bb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions compiler/rustc_span/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -1917,7 +1918,6 @@ where
Some(pos) => pos,
None => {
Hash::hash(&TAG_INVALID_SPAN, hasher);
span.ctxt.hash_stable(ctx, hasher);
return;
}
};
Expand All @@ -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);
}
}

Expand Down

0 comments on commit 34e92bb

Please sign in to comment.