diff options
| author | bors <bors@rust-lang.org> | 2020-10-09 08:09:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-10-09 08:09:32 +0000 |
| commit | fc3d8e3fccb86d6798ce89ca9eb28679908dc526 (patch) | |
| tree | 32518193920ac945a536d6863dc1f2bf75e62a39 | |
| parent | 9a74fb726ec40be398c55bce66c6d0b1a91d106c (diff) | |
| parent | 7367cfef598acb81a5e09b3bb28f55d01e35b4a3 (diff) | |
| download | rust-fc3d8e3fccb86d6798ce89ca9eb28679908dc526.tar.gz rust-fc3d8e3fccb86d6798ce89ca9eb28679908dc526.zip | |
Auto merge of #77687 - est31:hash_shorter_path, r=davidtwco
Use shorter path for std::hash::Hash
| -rw-r--r-- | compiler/rustc_span/src/lib.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index e7cb8cb6e88..925f1bd33cb 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -1861,7 +1861,7 @@ where } if *self == DUMMY_SP { - std::hash::Hash::hash(&TAG_INVALID_SPAN, hasher); + Hash::hash(&TAG_INVALID_SPAN, hasher); return; } @@ -1872,28 +1872,28 @@ where let (file_lo, line_lo, col_lo) = match ctx.byte_pos_to_line_and_col(span.lo) { Some(pos) => pos, None => { - std::hash::Hash::hash(&TAG_INVALID_SPAN, hasher); + Hash::hash(&TAG_INVALID_SPAN, hasher); span.ctxt.hash_stable(ctx, hasher); return; } }; if !file_lo.contains(span.hi) { - std::hash::Hash::hash(&TAG_INVALID_SPAN, hasher); + Hash::hash(&TAG_INVALID_SPAN, hasher); span.ctxt.hash_stable(ctx, hasher); return; } - std::hash::Hash::hash(&TAG_VALID_SPAN, hasher); + Hash::hash(&TAG_VALID_SPAN, hasher); // We truncate the stable ID hash and line and column numbers. The chances // of causing a collision this way should be minimal. - std::hash::Hash::hash(&(file_lo.name_hash as u64), hasher); + Hash::hash(&(file_lo.name_hash as u64), hasher); let col = (col_lo.0 as u64) & 0xFF; let line = ((line_lo as u64) & 0xFF_FF_FF) << 8; let len = ((span.hi - span.lo).0 as u64) << 32; let line_col_len = col | line | len; - std::hash::Hash::hash(&line_col_len, hasher); + Hash::hash(&line_col_len, hasher); span.ctxt.hash_stable(ctx, hasher); } } |
