Skip to content

Commit 4cf2186

Browse files
committed
Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer
1 parent 1d7cf0f commit 4cf2186

File tree

50 files changed

+152
-67
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+152
-67
lines changed

Cargo.lock

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3317,6 +3317,7 @@ dependencies = [
33173317
"rand 0.8.5",
33183318
"rand_xoshiro",
33193319
"rustc_data_structures",
3320+
"rustc_hashes",
33203321
"rustc_index",
33213322
"rustc_macros",
33223323
"rustc_serialize",
@@ -3544,6 +3545,7 @@ dependencies = [
35443545
"rustc_errors",
35453546
"rustc_fluent_macro",
35463547
"rustc_fs_util",
3548+
"rustc_hashes",
35473549
"rustc_hir",
35483550
"rustc_index",
35493551
"rustc_llvm",
@@ -3586,6 +3588,7 @@ dependencies = [
35863588
"rustc_errors",
35873589
"rustc_fluent_macro",
35883590
"rustc_fs_util",
3591+
"rustc_hashes",
35893592
"rustc_hir",
35903593
"rustc_hir_pretty",
35913594
"rustc_incremental",
@@ -3658,6 +3661,7 @@ dependencies = [
36583661
"rustc-stable-hash",
36593662
"rustc_arena",
36603663
"rustc_graphviz",
3664+
"rustc_hashes",
36613665
"rustc_index",
36623666
"rustc_macros",
36633667
"rustc_serialize",
@@ -3768,6 +3772,7 @@ dependencies = [
37683772
"rustc_error_codes",
37693773
"rustc_error_messages",
37703774
"rustc_fluent_macro",
3775+
"rustc_hashes",
37713776
"rustc_hir",
37723777
"rustc_index",
37733778
"rustc_lexer",
@@ -3840,6 +3845,13 @@ version = "0.0.0"
38403845
name = "rustc_graphviz"
38413846
version = "0.0.0"
38423847

3848+
[[package]]
3849+
name = "rustc_hashes"
3850+
version = "0.0.0"
3851+
dependencies = [
3852+
"rustc-stable-hash",
3853+
]
3854+
38433855
[[package]]
38443856
name = "rustc_hir"
38453857
version = "0.0.0"
@@ -3849,6 +3861,7 @@ dependencies = [
38493861
"rustc_arena",
38503862
"rustc_ast",
38513863
"rustc_data_structures",
3864+
"rustc_hashes",
38523865
"rustc_index",
38533866
"rustc_macros",
38543867
"rustc_serialize",
@@ -4169,6 +4182,7 @@ dependencies = [
41694182
"rustc_feature",
41704183
"rustc_fluent_macro",
41714184
"rustc_graphviz",
4185+
"rustc_hashes",
41724186
"rustc_hir",
41734187
"rustc_hir_pretty",
41744188
"rustc_index",
@@ -4405,6 +4419,7 @@ dependencies = [
44054419
"measureme",
44064420
"rustc_data_structures",
44074421
"rustc_errors",
4422+
"rustc_hashes",
44084423
"rustc_hir",
44094424
"rustc_index",
44104425
"rustc_middle",
@@ -4428,6 +4443,7 @@ dependencies = [
44284443
"rustc_errors",
44294444
"rustc_feature",
44304445
"rustc_fluent_macro",
4446+
"rustc_hashes",
44314447
"rustc_hir",
44324448
"rustc_index",
44334449
"rustc_macros",
@@ -4488,6 +4504,7 @@ name = "rustc_serialize"
44884504
version = "0.0.0"
44894505
dependencies = [
44904506
"indexmap",
4507+
"rustc_hashes",
44914508
"rustc_macros",
44924509
"smallvec",
44934510
"tempfile",
@@ -4508,6 +4525,7 @@ dependencies = [
45084525
"rustc_feature",
45094526
"rustc_fluent_macro",
45104527
"rustc_fs_util",
4528+
"rustc_hashes",
45114529
"rustc_hir",
45124530
"rustc_lint_defs",
45134531
"rustc_macros",
@@ -4549,6 +4567,7 @@ dependencies = [
45494567
"md-5",
45504568
"rustc_arena",
45514569
"rustc_data_structures",
4570+
"rustc_hashes",
45524571
"rustc_index",
45534572
"rustc_macros",
45544573
"rustc_serialize",
@@ -4568,6 +4587,7 @@ dependencies = [
45684587
"rustc_abi",
45694588
"rustc_data_structures",
45704589
"rustc_errors",
4590+
"rustc_hashes",
45714591
"rustc_hir",
45724592
"rustc_middle",
45734593
"rustc_session",
@@ -4663,6 +4683,7 @@ dependencies = [
46634683
"rustc_data_structures",
46644684
"rustc_errors",
46654685
"rustc_fluent_macro",
4686+
"rustc_hashes",
46664687
"rustc_hir",
46674688
"rustc_index",
46684689
"rustc_infer",

compiler/rustc_abi/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ bitflags = "2.4.1"
99
rand = { version = "0.8.4", default-features = false, optional = true }
1010
rand_xoshiro = { version = "0.6.0", optional = true }
1111
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
12+
rustc_hashes = { path = "../rustc_hashes" }
1213
rustc_index = { path = "../rustc_index", default-features = false }
1314
rustc_macros = { path = "../rustc_macros", optional = true }
1415
rustc_serialize = { path = "../rustc_serialize", optional = true }

compiler/rustc_abi/src/layout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::fmt::{self, Write};
22
use std::ops::{Bound, Deref};
33
use std::{cmp, iter};
44

5-
use rustc_data_structures::stable_hasher::Hash64;
5+
use rustc_hashes::Hash64;
66
use rustc_index::Idx;
77
use tracing::debug;
88

compiler/rustc_abi/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ use std::ops::{Add, AddAssign, Mul, RangeInclusive, Sub};
4848
use std::str::FromStr;
4949

5050
use bitflags::bitflags;
51-
use rustc_data_structures::stable_hasher::Hash64;
5251
#[cfg(feature = "nightly")]
5352
use rustc_data_structures::stable_hasher::StableOrd;
53+
use rustc_hashes::Hash64;
5454
use rustc_index::{Idx, IndexSlice, IndexVec};
5555
#[cfg(feature = "nightly")]
5656
use rustc_macros::{Decodable_Generic, Encodable_Generic, HashStable_Generic};

compiler/rustc_codegen_llvm/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ rustc_data_structures = { path = "../rustc_data_structures" }
2525
rustc_errors = { path = "../rustc_errors" }
2626
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
2727
rustc_fs_util = { path = "../rustc_fs_util" }
28+
rustc_hashes = { path = "../rustc_hashes" }
2829
rustc_hir = { path = "../rustc_hir" }
2930
rustc_index = { path = "../rustc_index" }
3031
rustc_llvm = { path = "../rustc_llvm" }

compiler/rustc_codegen_llvm/src/common.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ use rustc_abi::{AddressSpace, HasDataLayout};
77
use rustc_ast::Mutability;
88
use rustc_codegen_ssa::common::TypeKind;
99
use rustc_codegen_ssa::traits::*;
10-
use rustc_data_structures::stable_hasher::{Hash128, HashStable, StableHasher};
10+
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
11+
use rustc_hashes::Hash128;
1112
use rustc_hir::def_id::DefId;
1213
use rustc_middle::bug;
1314
use rustc_middle::mir::interpret::{ConstAllocation, GlobalAlloc, Scalar};

compiler/rustc_codegen_ssa/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ rustc_data_structures = { path = "../rustc_data_structures" }
2525
rustc_errors = { path = "../rustc_errors" }
2626
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
2727
rustc_fs_util = { path = "../rustc_fs_util" }
28+
rustc_hashes = { path = "../rustc_hashes" }
2829
rustc_hir = { path = "../rustc_hir" }
2930
rustc_hir_pretty = { path = "../rustc_hir_pretty" }
3031
rustc_incremental = { path = "../rustc_incremental" }

compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ use std::fmt::Write;
1515

1616
use rustc_abi::Integer;
1717
use rustc_data_structures::fx::FxHashSet;
18-
use rustc_data_structures::stable_hasher::{Hash64, HashStable, StableHasher};
18+
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
19+
use rustc_hashes::Hash64;
1920
use rustc_hir::def_id::DefId;
2021
use rustc_hir::definitions::{DefPathData, DefPathDataName, DisambiguatedDefPathData};
2122
use rustc_hir::{CoroutineDesugaring, CoroutineKind, CoroutineSource, Mutability};

compiler/rustc_data_structures/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ rustc-rayon = { version = "0.5.1", features = ["indexmap"] }
1818
rustc-stable-hash = { version = "0.1.0", features = ["nightly"] }
1919
rustc_arena = { path = "../rustc_arena" }
2020
rustc_graphviz = { path = "../rustc_graphviz" }
21+
rustc_hashes = { path = "../rustc_hashes" }
2122
rustc_index = { path = "../rustc_index", package = "rustc_index" }
2223
rustc_macros = { path = "../rustc_macros" }
2324
rustc_serialize = { path = "../rustc_serialize" }

compiler/rustc_data_structures/src/fingerprint.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
use std::hash::{Hash, Hasher};
22

3+
use rustc_hashes::Hash64;
34
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
45

5-
use crate::stable_hasher::{
6-
FromStableHash, Hash64, StableHasherHash, impl_stable_traits_for_trivial_type,
7-
};
6+
use crate::stable_hasher::{FromStableHash, StableHasherHash, impl_stable_traits_for_trivial_type};
87

98
#[cfg(test)]
109
mod tests;

0 commit comments

Comments
 (0)