Use uplifted rustc-stable-hash
crate in rustc_data_structures
· rust-lang/rust@977439d (original) (raw)
11 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -3514,6 +3514,12 @@ version = "1.1.0" | ||
3514 | 3514 | source = "registry+https://github.com/rust-lang/crates.io-index" |
3515 | 3515 | checksum = "5be1bdc7edf596692617627bbfeaba522131b18e06ca4df2b6b689e3c5d5ce84" |
3516 | 3516 | |
3517 | +[[package]] | |
3518 | +name = "rustc-stable-hash" | |
3519 | +version = "0.1.0" | |
3520 | +source = "registry+https://github.com/rust-lang/crates.io-index" | |
3521 | +checksum = "e5c9f15eec8235d7cb775ee6f81891db79b98fd54ba1ad8fae565b88ef1ae4e2" | |
3522 | + | |
3517 | 3523 | [[package]] |
3518 | 3524 | name = "rustc-std-workspace-alloc" |
3519 | 3525 | version = "1.99.0" |
@@ -3852,6 +3858,7 @@ dependencies = [ | ||
3852 | 3858 | "portable-atomic", |
3853 | 3859 | "rustc-hash", |
3854 | 3860 | "rustc-rayon", |
3861 | +"rustc-stable-hash", | |
3855 | 3862 | "rustc_arena", |
3856 | 3863 | "rustc_graphviz", |
3857 | 3864 | "rustc_index", |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -15,6 +15,7 @@ jobserver_crate = { version = "0.1.28", package = "jobserver" } | ||
15 | 15 | measureme = "11" |
16 | 16 | rustc-hash = "1.1.0" |
17 | 17 | rustc-rayon = { version = "0.5.0", optional = true } |
18 | +rustc-stable-hash = { version = "0.1.0", features = ["nightly"] } | |
18 | 19 | rustc_arena = { path = "../rustc_arena" } |
19 | 20 | rustc_graphviz = { path = "../rustc_graphviz" } |
20 | 21 | rustc_index = { path = "../rustc_index", package = "rustc_index" } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
1 | 1 | use crate::stable_hasher::impl_stable_traits_for_trivial_type; |
2 | -use crate::stable_hasher::{Hash64, StableHasher, StableHasherResult}; | |
2 | +use crate::stable_hasher::{FromStableHash, Hash64, StableHasherHash}; | |
3 | 3 | use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; |
4 | 4 | use std::hash::{Hash, Hasher}; |
5 | 5 | |
@@ -154,10 +154,11 @@ impl FingerprintHasher for crate::unhash::Unhasher { | ||
154 | 154 | } |
155 | 155 | } |
156 | 156 | |
157 | -impl StableHasherResult for Fingerprint { | |
157 | +impl FromStableHash for Fingerprint { | |
158 | +type Hash = StableHasherHash; | |
159 | + | |
158 | 160 | #[inline] |
159 | -fn finish(hasher: StableHasher) -> Self { | |
160 | -let (_0, _1) = hasher.finalize(); | |
161 | +fn from(StableHasherHash([_0, _1]): Self::Hash) -> Self { | |
161 | 162 | Fingerprint(_0, _1) |
162 | 163 | } |
163 | 164 | } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -11,7 +11,7 @@ | ||
11 | 11 | //! connect the fact that they can only be produced by a `StableHasher` to their |
12 | 12 | //! `Encode`/`Decode` impls. |
13 | 13 | |
14 | -use crate::stable_hasher::{StableHasher, StableHasherResult}; | |
14 | +use crate::stable_hasher::{FromStableHash, StableHasherHash}; | |
15 | 15 | use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; |
16 | 16 | use std::fmt; |
17 | 17 | use std::ops::BitXorAssign; |
@@ -56,10 +56,12 @@ impl<D: Decoder> Decodable for Hash64 { | ||
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
59 | -impl StableHasherResult for Hash64 { | |
59 | +impl FromStableHash for Hash64 { | |
60 | +type Hash = StableHasherHash; | |
61 | + | |
60 | 62 | #[inline] |
61 | -fn finish(hasher: StableHasher) -> Self { | |
62 | -Self { inner: hasher.finalize().0 } | |
63 | +fn from(StableHasherHash([_0, __1]): Self::Hash) -> Self { | |
64 | +Self { inner: _0 } | |
63 | 65 | } |
64 | 66 | } |
65 | 67 | |
@@ -121,10 +123,11 @@ impl<D: Decoder> Decodable for Hash128 { | ||
121 | 123 | } |
122 | 124 | } |
123 | 125 | |
124 | -impl StableHasherResult for Hash128 { | |
126 | +impl FromStableHash for Hash128 { | |
127 | +type Hash = StableHasherHash; | |
128 | + | |
125 | 129 | #[inline] |
126 | -fn finish(hasher: StableHasher) -> Self { | |
127 | -let (_0, _1) = hasher.finalize(); | |
130 | +fn from(StableHasherHash([_0, _1]): Self::Hash) -> Self { | |
128 | 131 | Self { inner: u128::from(_0) | (u128::from(_1) << 64) } |
129 | 132 | } |
130 | 133 | } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -24,7 +24,6 @@ | ||
24 | 24 | #![feature(core_intrinsics)] |
25 | 25 | #![feature(extend_one)] |
26 | 26 | #![feature(hash_raw_entry)] |
27 | -#![feature(hasher_prefixfree_extras)] | |
28 | 27 | #![feature(macro_metavar_expr)] |
29 | 28 | #![feature(map_try_insert)] |
30 | 29 | #![feature(min_specialization)] |
@@ -67,7 +66,6 @@ pub mod owned_slice; | ||
67 | 66 | pub mod packed; |
68 | 67 | pub mod profiling; |
69 | 68 | pub mod sharded; |
70 | -pub mod sip128; | |
71 | 69 | pub mod small_c_str; |
72 | 70 | pub mod snapshot_map; |
73 | 71 | pub mod sorted_map; |