Skip to content

Commit 977439d

Browse files
committed
Use uplifted rustc-stable-hash crate in rustc_data_structures
1 parent 0c81f94 commit 977439d

11 files changed

Lines changed: 30 additions & 1049 deletions

File tree

‎Cargo.lock‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3514,6 +3514,12 @@ version = "1.1.0"
35143514
source = "registry+https://github.com/rust-lang/crates.io-index"
35153515
checksum = "5be1bdc7edf596692617627bbfeaba522131b18e06ca4df2b6b689e3c5d5ce84"
35163516

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+
35173523
[[package]]
35183524
name = "rustc-std-workspace-alloc"
35193525
version = "1.99.0"
@@ -3852,6 +3858,7 @@ dependencies = [
38523858
"portable-atomic",
38533859
"rustc-hash",
38543860
"rustc-rayon",
3861+
"rustc-stable-hash",
38553862
"rustc_arena",
38563863
"rustc_graphviz",
38573864
"rustc_index",

‎compiler/rustc_data_structures/Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobserver_crate = { version = "0.1.28", package = "jobserver" }
1515
measureme = "11"
1616
rustc-hash = "1.1.0"
1717
rustc-rayon = { version = "0.5.0", optional = true }
18+
rustc-stable-hash = { version = "0.1.0", features = ["nightly"] }
1819
rustc_arena = { path = "../rustc_arena" }
1920
rustc_graphviz = { path = "../rustc_graphviz" }
2021
rustc_index = { path = "../rustc_index", package = "rustc_index" }

‎compiler/rustc_data_structures/src/fingerprint.rs‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
usecrate::stable_hasher::impl_stable_traits_for_trivial_type;
2-
usecrate::stable_hasher::{Hash64,StableHasher,StableHasherResult};
2+
usecrate::stable_hasher::{FromStableHash,Hash64,StableHasherHash};
33
use rustc_serialize::{Decodable,Decoder,Encodable,Encoder};
44
use std::hash::{Hash,Hasher};
55

@@ -154,10 +154,11 @@ impl FingerprintHasher for crate::unhash::Unhasher {
154154
}
155155
}
156156

157-
implStableHasherResultforFingerprint{
157+
implFromStableHashforFingerprint{
158+
typeHash = StableHasherHash;
159+
158160
#[inline]
159-
fnfinish(hasher:StableHasher) -> Self{
160-
let(_0, _1) = hasher.finalize();
161+
fnfrom(StableHasherHash([_0, _1]):Self::Hash) -> Self{
161162
Fingerprint(_0, _1)
162163
}
163164
}

‎compiler/rustc_data_structures/src/hashes.rs‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! connect the fact that they can only be produced by a `StableHasher` to their
1212
//! `Encode`/`Decode` impls.
1313
14-
usecrate::stable_hasher::{StableHasher,StableHasherResult};
14+
usecrate::stable_hasher::{FromStableHash,StableHasherHash};
1515
use rustc_serialize::{Decodable,Decoder,Encodable,Encoder};
1616
use std::fmt;
1717
use std::ops::BitXorAssign;
@@ -56,10 +56,12 @@ impl<D: Decoder> Decodable<D> for Hash64 {
5656
}
5757
}
5858

59-
implStableHasherResultforHash64{
59+
implFromStableHashforHash64{
60+
typeHash = StableHasherHash;
61+
6062
#[inline]
61-
fnfinish(hasher:StableHasher) -> Self{
62-
Self{inner:hasher.finalize().0}
63+
fnfrom(StableHasherHash([_0, __1]):Self::Hash) -> Self{
64+
Self{inner:_0}
6365
}
6466
}
6567

@@ -121,10 +123,11 @@ impl<D: Decoder> Decodable<D> for Hash128 {
121123
}
122124
}
123125

124-
implStableHasherResultforHash128{
126+
implFromStableHashforHash128{
127+
typeHash = StableHasherHash;
128+
125129
#[inline]
126-
fnfinish(hasher:StableHasher) -> Self{
127-
let(_0, _1) = hasher.finalize();
130+
fnfrom(StableHasherHash([_0, _1]):Self::Hash) -> Self{
128131
Self{inner: u128::from(_0) | (u128::from(_1) << 64)}
129132
}
130133
}

‎compiler/rustc_data_structures/src/lib.rs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#![feature(core_intrinsics)]
2525
#![feature(extend_one)]
2626
#![feature(hash_raw_entry)]
27-
#![feature(hasher_prefixfree_extras)]
2827
#![feature(macro_metavar_expr)]
2928
#![feature(map_try_insert)]
3029
#![feature(min_specialization)]
@@ -67,7 +66,6 @@ pub mod owned_slice;
6766
pubmod packed;
6867
pubmod profiling;
6968
pubmod sharded;
70-
pubmod sip128;
7169
pubmod small_c_str;
7270
pubmod snapshot_map;
7371
pubmod sorted_map;

0 commit comments

Comments
 (0)